Page 1 of 1

Problem with accented letters [SOLVED]

Posted: Sat Apr 19, 2014 8:34 am
by atout66
Hi to all,

I have a problem when I have accented letters in a custom propertie and I put them in a variable.
I lose the accentuations ...
For example in a custom propertie I store the word : "Références"
If I want to put this custom propertie into a var to deal with it later, the var store : "Références". But the custom property own "Références"!

So if I must compare "Références" with a other word, in fact I compare "Références" and that doesn't work for sure.

Not sure if I'm clear enought :wink:

Any idea ?

Kind regards, Jean-Paul.

Re: Problem with accented letters

Posted: Sat Apr 19, 2014 9:40 am
by jmburnod
Bonjour Jean-Paul,
I use customprop to store data with accented letters without problem.

I tested :

Code: Select all

on mouseUp
   set the uMyRef of this stack to "références"
   put the uMyRef of this stack 
end mouseUp
and the result is as expected "références

"Références" is strange for me yet, but I'm sure some users of this forum have an answer

Kind regards
Jean-Marc

Re: Problem with accented letters

Posted: Sat Apr 19, 2014 11:49 am
by Klaus
Bonjour mes amis,

this only happens when you enter the content into a custom property on a Mac and retrieve it on Windows (or vice versa).
That is because, unlike the content of fields, the content of custom properties will NOT be translated to the appropriate
platform text encoding.

In other words, this should not happen on the SAME platform!?
And works here, of course.

Anything else that might "interfere" in your stack somehow?


Best

Klaus

Re: Problem with accented letters

Posted: Sat Apr 19, 2014 12:42 pm
by atout66
Oups ! I'm confused... You're both right.
I've done the test like Jean-Marc suggested and it's exact. Also, I'm on the same plateforme.
I must have done something wrong with my variables, so I go back to the Code Editor and try to find where is my mistake.

Sorry for the inconvenience...

Kind regards, Jean-Paul.

Re: Problem with accented letters [SOLVED]

Posted: Sat Apr 19, 2014 1:15 pm
by atout66
Well, the problem is solved because the question was not the right one!
In fact the question is:
How can I convert a var which contains "Références" to have it containing "Références".

For Jean-Marc, I understand it sounds strange this "Références", but it's because it's taken from the code source of an HTML page.
For myself, I was expected "R.C3.A9f.C3.A9rences" and not "Références" too, but it is so...

The miracle is that when I use

Code: Select all

set the unicodeText of fld "leTest" to uniEncode (leMot, "UTF8") 
it displays "Références" correctly for both "R.C3.A9f.C3.A9rences" and "Références" :shock:
Not sure to be clear enough as I'm myself a little lost with all that conversions requirements :wink:

Kind regards, Jean-Paul.

Re: Problem with accented letters

Posted: Sat Apr 19, 2014 1:37 pm
by atout66
Hi to all,
To answer to myself, here is how I did to solve the problem.
I put the var with " "Références"" in a field with this code:

Code: Select all

set the unicodeText of fld "leTest" to uniEncode (leMot, "UTF8") 
This way the word "Références" is correct in the field, and then I load the text of the field into a var :!:
I know it's not so "pro" but for my needs, it's OK and I didn't find anything else :wink:

Thanks to all,
Jean-Paul.