Re: changing international text to unicode text
Re: changing international text to unicode text
- Subject: Re: changing international text to unicode text
- From: Christopher Nebel <email@hidden>
- Date: Mon, 20 Dec 2004 21:18:30 -0800
On Dec 20, 2004, at 1:32 PM, Kevin Meaney wrote:
consider the situation
"set theName to the name of thisDocument"
If I change the appleevent descriptor for the name property of
thisDocument from international text to unicode text what happens.
I see three possible scenarios:
1. Scripts will have to be rewritten because the appleevent descriptor
now indicates that the text is unicode rather than string? For example
what happens if you compare unicode to a string, does the string get
upgraded to unicode and then the comparison is performed or does the
string need to be converted in the script to unicode before doing the
comparison: set u to s as Unicode text
2. Will the scripts work just by having to recompile them?
3. Will the scripts just work without having to be recompiled or
anything?
In general, the answer is #3 -- for most purposes, "string" and
"Unicode text" work the same, so you can upgrade a property to Unicode
without anyone caring. (I can hear various people sputtering in the
background. Wait for the fine print.)
There are certain exceptions that cause the answer to be #1 in some
cases, such as trying to pass "Unicode text" to something that expects
a type code, such as the Finder's "file type" property. In general,
these are considered bugs in the consuming application, but that can be
small consolation to the poor sap whose script just went belly up.
Contrariwise, various pieces of AppleScript have been upgraded to
Unicode text over the past few releases, and while it has caused
occasional trouble, it's generally regarded as a good thing.
(#2 is not a possibility -- if there's a problem, then merely
recompiling is not going to fix it.)
--Chris Nebel
AppleScript Engineering
_______________________________________________
Do not post admin requests to the list. They will be ignored.
Applescript-users mailing list (email@hidden)
Help/Unsubscribe/Update your Subscription:
This email sent to email@hidden