Page 1 of 1

Foreign letters - messed up between mac and windows

Posted: Thu May 08, 2014 10:31 pm
by Sjatplat
I've been coding on the mac lately and wanted to test my app in windows when I discovered that the the foreign letters i've written in the fields is messed up in windows. (norwegian: æøå)

I use array to store the text the user creates and save the the array to file with arrayencode/decode....Could this have anything to do with it?

Sjat

Re: Foreign letters - messed up between mac and windows

Posted: Fri May 09, 2014 10:01 am
by MaxV
I think that you should activate the unicode text:

Code: Select all

set the useUnicode to true
put the unicodeText of fld "NorvegianText" into mytempArray

Re: Foreign letters - messed up between mac and windows

Posted: Fri May 09, 2014 1:35 pm
by BvG
Actually I think in this case it'd be enough to use mactoiso() and isotomac() at the correct place.

Re: Foreign letters - messed up between mac and windows

Posted: Sat May 10, 2014 9:59 am
by Sjatplat
Thank you, Bvg and MaxV

Both options worked. This means that I now have a huge pile of work to do - since my app is text-based and I have a lot of fields with input and output. Damn. My whole app is text based and I have to make sure it works on all platforms for all languages....
I might as well go for unicode.
Yet again - Livecode have some nasty surprises. I used Livecode for this project because of it´s text handling power...

Anyway - thanks for the help

Re: Foreign letters - messed up between mac and windows

Posted: Sat May 10, 2014 10:18 am
by Simon
Hi Sjat,
Are you using liveCode 7.0?
"Unicode just works" Right?

Simon

Re: Foreign letters - messed up between mac and windows

Posted: Sat May 10, 2014 3:14 pm
by Sjatplat
Simon, oh my, that was a relief.

It seems to work by itself in 7. I have not used 7 because i was afraid of any bugs it might introduce...but I have no choice now do I :)

Thanks! Phew.

Re: Foreign letters - messed up between mac and windows

Posted: Sun May 11, 2014 4:51 am
by Simon
Hi Sjat,
So did you have to do anything else aside from upgrading to 7.0?
I'm very interested in learning if the new unicode stuff really is that easy.

Thanks,
Simon

Re: Foreign letters - messed up between mac and windows

Posted: Sun May 11, 2014 1:25 pm
by Sjatplat
Simon,

I will report back what I find. It will come in bits and pieces.
So far:
It seems for now that the only thing I have to do is write the help files again so it becomes unicode. But once I did it with one chapter the text is correct on both mac and windows. Other text is user made so it will depend on what language they use.
The area I have to do a thorough test is with my arrays - since some of the array keys will need to be unicode - depending on what the user types in.

My help file is also in an array and one thing that doesn´t work is "sort ascending numeric". I have different chapters with names that corresponds with an array key like: "1. Intro" and "2. How to begin" and so on. If I put the array keys in temp variable and do a "Sort Ascending numeric" on the variable and then put the result in a field it will not be sorted correctly as before. I tried to rename the keys but it didn´t help. Using "sort" without "ascending numeric" works as before except that the three extra norwegian letters at the end of the norwegian alphabet: "æ ø å" is not sorted correctly. They will be sorted at the end of the list but not in the correct order.

Sjat

Re: Foreign letters - messed up between mac and windows

Posted: Mon May 12, 2014 3:52 pm
by atout66
Hi Sjat,

I'm very interrested by your post because I've to deal a lot with text too.

I tried earlier the LC7 version, and tested the textEncode() function without success as said in this topic:
http://forums.runrev.com/viewtopic.php?f=7&t=19861

So if you get better results, please, let us know :wink:

Thanks in advance, Jean-Paul.