Need help with windows chars and mac chars

Mark Schonewille m.schonewille at economy-x-talk.com
Mon Nov 8 18:59:01 EST 2010


Hi Josep,

You might convert from Windows to Mac using the IsoToMac function, but a few characters will be converted incorrectly. Normally, my advice would be to set up the entire database with UTF8 encoding and convert all strings to UTF8 before writing them to the database. Search strings would need to be converted to UTF8 too.

I am surprised that even the word "demo" doesn't work for you, but I guess the reason is that the encryption doesn't return the same value on both platforms. You need to encode to UTF8 first and then encrypt. How do you do the encryption exactly?

When you are sure that the encoding and encryption are correct, then the ASCII values of all bytes of the encrypted string should be the same on both platforms, even though the characters displayed in a field may be different. As a last step, use the binaryEncode function to convert the string from binary to hexadecimal. The hex string should be exactly the same on both platforms.

Hexadecimal strings don't need to be encoded as UTF8 again. You can simply write to the Mac encoded database, since all characters 0-9 and A-F are the same regardless the encoding. 

--
Best regards,

Mark Schonewille

Economy-x-Talk Consulting and Software Engineering
Homepage: http://economy-x-talk.com
Twitter: http://twitter.com/xtalkprogrammer
KvK: 50277553

Economy-x-Talk on Facebook now and get a free Color Converter license http://qurl.tk/gn (read the conditions)

On 9 nov 2010, at 00:30, JosepM wrote:

> 
> Hi everyone,
> 
> I made a mess with the coding of characters between windows - mac and mac -
> windows.
> 
> I have a function that encrypts a word and then validates the encrypted word
> with the value of the database. In Mac is working properly, but Windows
> doesn't. The value produced in Windows encryption has nothing to do with the
> Mac. I know the characters differences... but I'm lost. :(
> 
> The word is "demo", without accents or unusual characters.
> 
> What am I missing? Should I convert from Windows with ISOtoMac function?
> Also doesn't work.
> 
> Any ideas?
> 
> 
> Salut,
> Josep




More information about the use-livecode mailing list