Page 1 of 1

textEncode textDecode bug

Posted: Sat Mar 12, 2016 9:32 am
by brotee
i'm developing an app that synchronize data between ios and windows.

With the 6.x version livecode i used unidecode uniencode to save data to database, it worked pretty well.

but now it's, if i save something from ios with textencode the accents will be different than if i save from windows.

For example

if i save word "Férfi" from windows i get "Férfi" which is corrent, and its totally the same if i save with unidecode()
but from ios i get "Fܩ̩rfi" in my database.

So when i save something from ios and then i use textdecode on ios i get back the "Férfi" but on windows it won't be good, and if i save something from windows, it'll be good on windows, but on IOS it'll be "Frfi" without accents.
Unfortunatelly it's the same if i use unidecode command on 7.x version, on 6.x version it's still working but i need 7.x versions cause there are many new functions for ios i would use.

ty

Re: textEncode textDecode bug

Posted: Sat Mar 12, 2016 1:38 pm
by jmburnod
Hi brotee,
I have an app which can exchange files between iOS and windows, i have to use MacToIso and IsoToMac. Do you use them ?
Jean-Marc

Re: textEncode textDecode bug

Posted: Sat Mar 12, 2016 5:38 pm
by brotee
jmburnod wrote:Hi brotee,
I have an app which can exchange files between iOS and windows, i have to use MacToIso and IsoToMac. Do you use them ?
Jean-Marc
hi,

i have tried it, but wasn't work :(

I haven't used this 2 functions before, when i saved a field to database i was using:
unidecode(unicodtext of field "aaa", "utf8") and it was working every platform (ios android windows)
btw unidecode(unicodetext gives the same result like textencode(.. , "utf8") on windows, but on ios both functions gives back something else
shouldn't utf8 be platform independent?

Re: textEncode textDecode bug

Posted: Sat Mar 12, 2016 6:25 pm
by jacque
You shouldn't need to translate character sets if you use textEncode and textDecode. But your results sound like you aren't specifying the correct encodings. You should probably specify UTF8 for both import and export.

If you post those two lines of the script we can look.

Edit : our messages overlapped. I see you are using UTF8 already. Post a little more of the script anyway, maybe we'll see something else.

Re: textEncode textDecode bug

Posted: Mon Mar 14, 2016 4:47 pm
by brotee
yeah sorry my bad, i had problem with json encode/decode, finally i got it :) thanks for your helping anyway