Re: unicode escape sequences in AppleScript strings
Re: unicode escape sequences in AppleScript strings
- Subject: Re: unicode escape sequences in AppleScript strings
- From: Emmanuel <email@hidden>
- Date: Tue, 14 Jan 2003 16:39:06 +0100
At 4:14 PM -0800 13/01/03, Andy Bachorski wrote:
Is there a way to enter unicode escape sequences in a string in AppleScript.
My first (and only) attempt was to use the standard escape mechanism
set x to "my unicode string \u303d"
where \u303d is a standard escape sequence for representing a unicode
character in a non-unicode string. I get a compile error when trying to run
this script. I looked in the AppleScript help system but found nothing. I
looked in standard additions but found only ASCII calls. What am I missing?
<OT> Andy!!! So delighted to read a message from you after such a
long absence!!! </OT>
I would love that we could enter some UTF-8 into an AppleScript
string variable - which is how I interpret what you're trying to
achieve.
Unfortunately, AFAIK, there is no way of filling an AppleScript
variable with UTF-8 (let alone 16) from scratch - you've got to
export Unicode from a Unicode-able app or from a file.
I suppose that if the AppleScript Text Suite was to work on Unicode
text, then it would work very slowly since there is no longer a
one-to-one correspondance between bytes and characters in Unicode, so
(e.g.) getting "character n" of some string would really imply
reading the whole data from the first byte.
(I would like to be wrong)
Emmanuel
_______________________________________________
applescript-users mailing list | email@hidden
Help/Unsubscribe/Archives:
http://www.lists.apple.com/mailman/listinfo/applescript-users
Do not post admin requests to the list. They will be ignored.