• 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: alias as string = as Unicode text?
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

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.

  • Follow-Ups:
    • Re: alias as string = as Unicode text?
      • From: Paul Berkowitz <email@hidden>
References: 
 >alias as string = as Unicode text? (From: Paul Berkowitz <email@hidden>)

  • Prev by Date: Importing Sigs to Mail.app
  • Next by Date: Re: MacRoman to hex-ISO Latin 1 [was: MacRoman to ISO Latin 1 [was:...]]
  • Previous by thread: Re: alias as string = as Unicode text?
  • Next by thread: Re: alias as string = as Unicode text?
  • Index(es):
    • Date
    • Thread