• Open Menu Close Menu
  • Apple
  • Shopping Bag
  • Apple
  • Mac
  • iPad
  • iPhone
  • Watch
  • TV
  • Music
  • Support
  • Search apple.com
  • Shopping Bag

Lists

Open Menu Close Menu
  • Terms and Conditions
  • Lists hosted on this site
  • Email the Postmaster
  • Tips for posting to public mailing lists
Re: changing international text to unicode text
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

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
References: 
 >changing international text to unicode text (From: Kevin Meaney <email@hidden>)
 >Re: changing international text to unicode text (From: Emmanuel <email@hidden>)
 >Re: changing international text to unicode text (From: Joseph Weaks <email@hidden>)
 >Re: changing international text to unicode text (From: Christopher Nebel <email@hidden>)
 >Re: changing international text to unicode text (From: Emmanuel <email@hidden>)
 >Re: changing international text to unicode text (From: Kevin Meaney <email@hidden>)

  • Prev by Date: Re: Applescript-users Digest, Vol 1, Issue 270
  • Next by Date: Re: Applescript-users Digest, Vol 1, Issue 271
  • Previous by thread: Re: changing international text to unicode text
  • Next by thread: Re: changing international text to unicode text
  • Index(es):
    • Date
    • Thread