Re: alias as string = as Unicode text?
Re: alias as string = as Unicode text?
- Subject: Re: alias as string = as Unicode text?
- From: Christopher Nebel <email@hidden>
- Date: Mon, 20 May 2002 04:18:53 -0700
On Friday, May 17, 2002, at 07:58 PM, Paul Berkowitz wrote:
AS 1.6 and later:
Since alias format now works with file and folder names in Unicode, what
happens when you coerce an alias 'as string'? According to Script
Debugger,
the result is "international text": is that as good as Unicode in this
context? I.e. , when you've got a folder as an alias in a variable
theFolder, is there any point to doing:
set folderPath to (theFolder as string) as Unicode text
set theItems to list folder theFolder -- result is list of Unicode
text in OS 10.1.x
repeat with i from 1 to (count theItems)
set itemName to item i of theItems
set theItem to alias (folderPath & itemName) as Unicode text
-- ... etc.
Will this always work? That is, will the first line actually give the
folderPath in its proper Unicode form, or does the 'as string' mangle
non-ASCII characters in the path, so that setting the result 'as Unicode
text' is pointless?
"as string" produces an AppleScript string, which is actually styled
text. As such, it can represent many (but not all) Unicode characters.
For instance, it can cope perfectly well with a mix of French and
Chinese. However, it probably couldn't handle Arabic or some of the
special symbol characters, because there's no supported encoding for
them other than Unicode. I'd suggest coercing folderPath straight to
Unicode text, though I'm not sure that it will produce any better
results -- there are some internal paths that still go through styled
text.
--Chris Nebel
AppleScript Engineering
_______________________________________________
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.