saving unicodetext

Getting into LiveCode for iOS? Ask your questions here.

Moderators: FourthWorld, heatherlaine, Klaus, kevinmiller, robinmiller

Post Reply
scotttyang
Posts: 125
Joined: Sat Jan 31, 2009 12:01 am

saving unicodetext

Post by scotttyang » Mon Apr 08, 2013 2:48 am

So here, I am finishing a Chinese App and wanting to save the unicode in a fld to a .txt file, and I just get gibberish...eg

 set the defaultFolder to specialFolderPath("Documents")
put the unicodetext of fld "scrollfield" into URL ("file:mylist.txt")

or

 set the defaultFolder to specialFolderPath("Documents")
  set the unicodetext URL ("file:mylist.txt") to the unicodetext of fld "scrollfield"

and the file won't save.

Any ideas of my syntax that won't let me save unicode field into a .txt file?

Scott

endernafi
VIP Livecode Opensource Backer
VIP Livecode Opensource Backer
Posts: 296
Joined: Wed May 02, 2012 12:23 pm
Contact:

Re: saving unicodetext

Post by endernafi » Mon Apr 08, 2013 4:03 pm

Hi Scott,

Try this:

Code: Select all

put uniDecode(the unicodeText of fld "scrollfield", "utf8") into URL ("file:mylist.txt")
And when it's time to read, don't forget to uniEncode the content first.

Hope it helps...


Best,

~ Ender Nafi
~... together, we're smarter ...~
__________________________________________

macOS Sierra • LiveCode 7 & xCode 8

scotttyang
Posts: 125
Joined: Sat Jan 31, 2009 12:01 am

Re: saving unicodetext

Post by scotttyang » Mon Apr 08, 2013 4:42 pm

that would have taken me another 10 hours just to figure that one out! thanks!

Scott

Post Reply