textEncode textDecode bug

Getting into LiveCode for iOS? Ask your questions here.

Moderators: FourthWorld, heatherlaine, Klaus, kevinmiller, robinmiller

Post Reply
brotee
Posts: 31
Joined: Sat Mar 12, 2016 9:15 am

textEncode textDecode bug

Post by brotee » Sat Mar 12, 2016 9:32 am

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

jmburnod
VIP Livecode Opensource Backer
VIP Livecode Opensource Backer
Posts: 2729
Joined: Sat Dec 22, 2007 5:35 pm
Contact:

Re: textEncode textDecode bug

Post by jmburnod » Sat Mar 12, 2016 1:38 pm

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
https://alternatic.ch

brotee
Posts: 31
Joined: Sat Mar 12, 2016 9:15 am

Re: textEncode textDecode bug

Post by brotee » Sat Mar 12, 2016 5:38 pm

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?

jacque
VIP Livecode Opensource Backer
VIP Livecode Opensource Backer
Posts: 7390
Joined: Sat Apr 08, 2006 8:31 pm
Contact:

Re: textEncode textDecode bug

Post by jacque » Sat Mar 12, 2016 6:25 pm

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.
Jacqueline Landman Gay | jacque at hyperactivesw dot com
HyperActive Software | http://www.hyperactivesw.com

brotee
Posts: 31
Joined: Sat Mar 12, 2016 9:15 am

Re: textEncode textDecode bug

Post by brotee » Mon Mar 14, 2016 4:47 pm

yeah sorry my bad, i had problem with json encode/decode, finally i got it :) thanks for your helping anyway

Post Reply