Page 1 of 1

saving unicodetext

Posted: Mon Apr 08, 2013 2:48 am
by scotttyang
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

Re: saving unicodetext

Posted: Mon Apr 08, 2013 4:03 pm
by endernafi
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

Re: saving unicodetext

Posted: Mon Apr 08, 2013 4:42 pm
by scotttyang
that would have taken me another 10 hours just to figure that one out! thanks!

Scott