Foreign letters - messed up between mac and windows

Got a LiveCode personal license? Are you a beginner, hobbyist or educator that's new to LiveCode? This forum is the place to go for help getting started. Welcome!

Moderators: Klaus, FourthWorld, heatherlaine, kevinmiller

Post Reply
Sjatplat
Livecode Opensource Backer
Livecode Opensource Backer
Posts: 75
Joined: Wed Jun 22, 2011 1:53 pm
Location: Norway

Foreign letters - messed up between mac and windows

Post by Sjatplat » Thu May 08, 2014 10:31 pm

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

MaxV
Posts: 1574
Joined: Tue May 28, 2013 2:20 pm
Location: Italy
Contact:

Re: Foreign letters - messed up between mac and windows

Post by MaxV » Fri May 09, 2014 10:01 am

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
Livecode Wiki: http://livecode.wikia.com
My blog: https://livecode-blogger.blogspot.com
To post code use this: http://tinyurl.com/ogp6d5w

BvG
VIP Livecode Opensource Backer
VIP Livecode Opensource Backer
Posts: 1236
Joined: Sat Apr 08, 2006 1:10 pm
Location: Zurich
Contact:

Re: Foreign letters - messed up between mac and windows

Post by BvG » Fri May 09, 2014 1:35 pm

Actually I think in this case it'd be enough to use mactoiso() and isotomac() at the correct place.
Various teststacks and stuff:
http://bjoernke.com

Chat with other RunRev developers:
chat.freenode.net:6666 #livecode

Sjatplat
Livecode Opensource Backer
Livecode Opensource Backer
Posts: 75
Joined: Wed Jun 22, 2011 1:53 pm
Location: Norway

Re: Foreign letters - messed up between mac and windows

Post by Sjatplat » Sat May 10, 2014 9:59 am

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

Simon
VIP Livecode Opensource Backer
VIP Livecode Opensource Backer
Posts: 3901
Joined: Sat Mar 24, 2007 2:54 am
Location: Palo Alto

Re: Foreign letters - messed up between mac and windows

Post by Simon » Sat May 10, 2014 10:18 am

Hi Sjat,
Are you using liveCode 7.0?
"Unicode just works" Right?

Simon
I used to be a newbie but then I learned how to spell teh correctly and now I'm a noob!

Sjatplat
Livecode Opensource Backer
Livecode Opensource Backer
Posts: 75
Joined: Wed Jun 22, 2011 1:53 pm
Location: Norway

Re: Foreign letters - messed up between mac and windows

Post by Sjatplat » Sat May 10, 2014 3:14 pm

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.

Simon
VIP Livecode Opensource Backer
VIP Livecode Opensource Backer
Posts: 3901
Joined: Sat Mar 24, 2007 2:54 am
Location: Palo Alto

Re: Foreign letters - messed up between mac and windows

Post by Simon » Sun May 11, 2014 4:51 am

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
I used to be a newbie but then I learned how to spell teh correctly and now I'm a noob!

Sjatplat
Livecode Opensource Backer
Livecode Opensource Backer
Posts: 75
Joined: Wed Jun 22, 2011 1:53 pm
Location: Norway

Re: Foreign letters - messed up between mac and windows

Post by Sjatplat » Sun May 11, 2014 1:25 pm

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

atout66
Posts: 266
Joined: Wed Feb 02, 2011 12:31 pm
Location: France

Re: Foreign letters - messed up between mac and windows

Post by atout66 » Mon May 12, 2014 3:52 pm

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.
Discovering LiveCode Community 6.5.2.

Post Reply

Return to “Getting Started with LiveCode - Complete Beginners”