Line Breaks Dropped on Importing Unicode Text

Kenji Kojima index at kenjikojima.com
Fri Sep 4 08:35:30 EDT 2009


Hi Sivakatirswami,

> I have some UTF-16 unicode raw text. If I import this into Pages, it  
> displays the font correctly and also the line breaks between  
> paragraphs correctly
>
> But if I use this function:
>
> on mouseUp
> answer file "Choose a unicode file to read in."
> if it is empty then exit mouseUp
> put "binfile:" & it into urlName
> replace numtochar(13) with numtochar(10) in urlName
> set the unicodeText of fld "display" to url urlName
> end mouseUp
>
> the line breaks are not appearing in the field in revolution.


It worked. I used Japanese UTF-16 on Mac OS 10.6, Revolution 4.0.


> Also if I try to analyze what chars are there, where the line break  
> should be, by selecting across a missing line break and then use  
> this test:
>
> on mouseUp
>  set the useUnicode to true
>  if the selection is empty then
>     answer "No Selection" with "ok"
>  end if
>  put the selection into tUnicode
>  put tUnicode
>  repeat for each char x in tUnicode
>     put  chartonum(x) & cr after tOutput      end repeat
> put tOutput # returns empty
> end mouseUp



it should be

   repeat with i=1 to the num of chars of tUnicode step 2
       put  chartonum(char i to i+1 of tUnicode) & cr after tOutput
    end repeat


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






More information about the use-livecode mailing list