unicodeText problem with Japanese

Kenji Kojima index at kenjikojima.com
Mon Mar 26 12:09:19 EDT 2007


On Mar 23, 2007, at 10:26 AM, Devin Asay wrote:

> Nicolas,
>
> I'm not sure what's causing your problems. Could it be related to  
> this bug?
>
> http://quality.runrev.com/qacenter/show_bug.cgi?id=3614

He contacted me and we found the problems.
You cannot see the problems on Windows XP,
but the problems appear on Windows2000(maybe before OS too).

Importing UTF-16 Japanese text in Rev Field on Windows2000.
• BOM changes to a garbage character.
• CRLF of UTF-16 changes to a garbage character.

the script has to be: for XP and 2000

on mouseUp
    answer file "Select Japanese Text"
    put url ("binfile:" & it) into tURL
    set the useUnicode to true
    if baseConvert(charToNum(char 1 to 2 of tUTF16), 10, 16) = "FEFF"  
then
        delete char 1 to 2 of tURL
    end if
    replace (uniencode(CRLF)) with (uniencode(CR)) in tURL
    set the unicodeText of fld "Japanese" to tURL
end mouseUp

--
And MacOSX 10.3 Panther has the same BOM problem.
But You cannot see it on 10.4 Tiger.


--
Kenji Kojima
http://www.kenjikojima.com/







More information about the use-livecode mailing list