Line Breaks Dropped on Importing Unicode Text

Joe F. joef1 at mac.com
Sat Sep 5 00:02:10 EDT 2009


Aloha (in NYC we just say howyadoin'?)

I had some trouble getting unicode text to do what I expected in Rev.
My understanding at the moment is this:

Rev handles text internally as utf16, that's the unicodetext.
No matter where you put it or display it, it's still the unicodetext.

Rev supposedly handles all conversions, which I interpret as line  
endings and byte order, and that seems to be the case as long as I  
specify what to uniencode to and unidecode from.

I'm using OS/X and working on a stack that will be a Windows standalone.
I needed utf8 to make round trips to the web server and got all kinds  
of weird results until I started encoding/decoding at every step. Then  
is worked fine.

I'm using TextWrangler and it seems to detect and save just fine.
TextEdit I think will automatically convert line endings, so probably  
Pages as well.

Joe F.

On Sep 4, 2009, at 6:01 PM, Sivakatirswami wrote:

> Aloha, Joe:
>
> I'm not quite sure how your suggestion relates to the problem of  
> endlines.
>
> The unicode.txt file I have is being read OK in Pages on the mac.
> It also loads just fine in Rev, with the exception of the line breaks
>
> I'm not sure where the uniencode/unidecode  could be used to solve  
> the line break issue.
>
> Sivakatirswami
>
>
>
>
> Joe F. wrote:
>> The trick is to use uniencode/unidecode for everything.
>> Three separate examples:
>>
>> ask file "Name new file:" with "NewFile.xml"
>> put "binfile:" & it into theNewFileName
>> get the unicodetext of cd fld 1
>> put unidecode(it,"utf8") into url (theNewFileName)
>> ------------------------------------------
>> set the unicodetext of cd fld 1 to uniencode(tMyUnicode,"utf8")
>> ------------------------------------------
>> put URL (theFTPRequest) into theDownLoadedText
>> put uniencode(theDownLoadedText,"utf8") into theDownLoadedText
>> put unidecode(theDownLoadedText,"ANSI") into cd fld 1 of cd id 4630
>>
>




More information about the use-livecode mailing list