Re: Unicode
Re: Unicode
- Subject: Re: Unicode
- From: Paul Berkowitz <email@hidden>
- Date: Wed, 26 Dec 2001 16:58:37 -0800
On 12/26/01 4:21 PM, I wrote:
>
What I have found is this:
>
>
AppleScript seems to need 'as Unicode text' when reading but not when
>
writing. This is true both for Entourage properties and for text files.
Just after writing that, I discovered a very serious limitation - not
unexpected. The wonderful device of using text item delimiters and coercing
a list to string does _not_ work with Unicode.
When I have done:
set {fName, lName} to {first name as Unicode text, last name as
Unicode text}
then
set ls to {fName, lName}
set AppleScript's text item delimiters to {tab}
set txt to ls as Unicode text
set AppleScript's text item delimiters to {""}
does not error, and it does set ls to some weird sort of text with very
strange characters, but it's useless at the other end. It does not convert
back to Japanese at all.
And the "shorthand"
set txt to "" & ls -- i.e. as string
doesn't work at all when you try to parse it with tab later .
This is going to make for some very tedious workarounds, especially since
you can't keep concatenating text forever. Using lists, then coercing to
string, is what always worked. Perhaps "accumulating" text with one
concatenation at a time will work OK.
In this present instance, I think I can write one line of text to the file
at a time, But this is getting awfully kludgy.
Is there any chance that "improved Unicode implementation" will eventually
bring coercion of lists of Unicode text to Unicode text using text item
delimiters? or can I get that right now if I go about it differently?
--
Paul Berkowitz