Importing Unicode text to a field .. How?

Web Admin Himalayan Academy katir at hindu.org
Fri May 27 22:55:53 EDT 2011


  nope... that replacement does nothing...

on mouseup
    answer file "Choose the Unicode for this song" with "OK"
    if the result ="cancel" then exit mouseup
    set the useUnicode to true
    set the unicodetext of fld "Unicode_Script" to url ("binfile:/" & it)
       # result: Tamil appears fine, but all one line

    replace numtochar(13) with numToChar(8232) in fld "Unicode_Script"
        #does nothing

end mouseup



for others who are interested in trying:

See if you can import any of these three files into a Live Code field 
(on the Mac you should have InaiMathi installed by default with the 
system, if you have Arial MS Unicode alive on the box it should also work.)

http://www.himalayanacademy.com/livecode/Unicode-Tamil.zip

has three files of "pure" unicode that works in all programs including 
LiveCode fields but only if you paste it in.

Goal: import by script.

Sivakatirswami




On 5/27/11 10:04 AM, Richmond Mathewson wrote:
>
> Unicode text is double-byte stuff, while the CR and LF are single-byte 
> things.
>
> SO . . . double-byte strings SHOULD always consist of an even number 
> of bytes,
>
> AND, if a text field is flagged as containing unicodeText when the 
> engine starts reading its contents
> it will start taking "double-byte bites" of the string.
>
> THEREFORE, inserting either numToChar(10) or numToChar(13) into a 
> double-byte text will
> throw the engine out of kilter because it will start "biting" 
> double-bytes "off".
>
> TAKE A LOOK at this:
>
> http://en.wikipedia.org/wiki/Newline
>
> and, just possibly, you need to replace you CR/LF with :
>
> numToChar(8232)
>
> worth a try . . .





More information about the use-livecode mailing list