Page 1 of 1

Handling Thai characters...

Posted: Wed Oct 09, 2013 10:00 am
by paulsr
Hi ... I'm trying, and failing, to display Thai characters in an app, and would much appreciate some guidance.

First I went to Google Translate so that I could create some Thai text. This I pasted into Wordpad and saved as "Unicode Text Document".

That seems to have worked because I can open the same document in OpenOffice Writer and I see the correct text. I did this in WindozeXP. If I open the file with TextEdit on a Mac, it also looks correct.

Then I tried to read that text into LC. My code looks like this:

Code: Select all

put "binfile:" & specialFolderpath("documents") & "/thai.txt" into tThai
put url tThai into tThaiText
set the unicodetext of fld "somefield" to uniencode(tThaiText,"UTF8")
What I see is a jumble of line drawing characters, musical notes, plus a few numbers. If I run the same app on a Mac, I see a string that looks like "5 L P 7"...etc.

Did I miss a step?

Many tkx...

--paul

Re: Handling Thai characters...

Posted: Wed Oct 09, 2013 10:35 am
by bangkok
No need to uniencode your file because it is already in unicode.

So here is the script :

Code: Select all

put "binfile:" & specialFolderpath("documents") & "/thai.txt" into tThai
put url tThai into tThaiText
set the unicodetext of fld "somefield" to tThaiText

Re: Handling Thai characters...

Posted: Wed Oct 09, 2013 11:19 am
by paulsr
bangkok wrote:No need to uniencode your file because it is already in unicode.
That makes sense. Many thanks...

--paul