• 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: Unicode Bad Characters
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: Unicode Bad Characters


  • Subject: Re: Unicode Bad Characters
  • From: Christopher Nebel <email@hidden>
  • Date: Wed, 6 Aug 2008 12:50:36 -0700

On Aug 6, 2008, at 7:23 AM, Luther Fuller wrote:

About a year ago, we had a long discussion, subject "Bad Character", then "Bad Characters from Unicode". I don't want to go into all the gory details, again. The very short explanation is: Unicode characters 128 thru 159 will break AppleScript code.

I've been looking at this problem, again, this week. In OS X 10.5.4 and 10.4.11, my code seems not to break. A year ago , I was using 10.4.10, so perhaps something has been fixed.

But I'm still curious about Unicode characters 128 thru 159. Character tables show them as control characters, but in Mail (in 10.4.10) some of them were displayable. In Leopard's Mail, they are not displayable characters. Leopard (10.5.4) will use these characters in a file name, but will not display them.

If you want to see how this works, here's a quick script ...

(character id 126) & (character id 127) & (character id 128) & (character id 129) & ¬
(character id 130) & (character id 131) & (character id 132) & (character id 158) & ¬
(character id 159) & (character id 160) & (character id 161)
tell application "Finder" to make new folder at (path to desktop) with properties {name:the result}


The new folder appears to be named "~ ¡". To see what it's really named, attempt to edit the name.

Does anyone know of any tech note or other documentation that explains how Leopard handles these characters?

Basically, that range (U+0080 through U+009F) is all control characters. (Unicode calls them the "C1 controls".) Some applications, in particular ones that accept text data from the Internet, such as Mail or Safari, will guess that their presence is simply because someone screwed up their encoding declaration, and display them as if they're ISO Latin-1 or something like that. AppleScript does not treat them specially. If they cause breakage, then file a bug, or at least describe the problem in more detail, but I doubt that the problem is in AppleScript itself.



--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:
Archives: http://lists.apple.com/archives/applescript-users

This email sent to email@hidden
References: 
 >Unicode Bad Characters (From: Luther Fuller <email@hidden>)

  • Prev by Date: UI Scripting a Save As Dialog
  • Next by Date: Re: Unicode Bad Characters
  • Previous by thread: Re: Unicode Bad Characters
  • Next by thread: Re: Unicode Bad Characters
  • Index(es):
    • Date
    • Thread