• 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: do shell script non-ASCII
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: do shell script non-ASCII


  • Subject: Re: do shell script non-ASCII
  • From: Philip Aker <email@hidden>
  • Date: Wed, 22 May 2002 13:57:21 -0700

On Wednesday, May 22, 2002, at 11:26 AM, Christopher Nebel wrote:

On Saturday, May 18, 2002, at 06:09 PM, Paul Berkowitz wrote:

When I 'do shell script' and the file name includes a non-ASCII character, even when I first coerce the file path with 'as Unicode text' the shell errors that it can't find any such file or directory. ... Is there something i can do about this?

Yes, but it's really horrendous. The problem is that sh wants everything as UTF-8, but "do shell script" extracts the command text using the primary encoding -- MacRoman, in your case. You therefore have to walk the command string substituting non-ASCII characters with the proper sequence of bytes for UTF-8, which always looks like total gibberish in MacRoman. To make matters worse, there's no way to get the code point value of an arbitrary Unicode character, because ASCII number also assumes MacRoman, so you have to have a big ugly lookup table. If you know you only need a few characters, then you only need a small table, but it still makes my skin crawl.

This is on the list to be fixed for Jaguar.


Is it possible to temporarily set/reset __CF_USER_TEXT_ENCODING for these calls to get the result required?


% env
...
__CF_USER_TEXT_ENCODING=0x1F6:0:0
...



mailto:&#112;&#104;&#105;&#108;&#105;&#112;&#64;&#118;&#99;&#110;&#46;&#98;
&#99;&#46;&#99;&#97;
_______________________________________________
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.

References: 
 >Re: do shell script non-ASCII (From: Christopher Nebel <email@hidden>)

  • Prev by Date: Re: trap information
  • Next by Date: getting unread info for Mail.app
  • Previous by thread: Re: do shell script non-ASCII
  • Next by thread: with administrator privileges...
  • Index(es):
    • Date
    • Thread