Re: do shell script non-ASCII
Re: do shell script non-ASCII
- Subject: Re: do shell script non-ASCII
- From: Christopher Nebel <email@hidden>
- Date: Wed, 22 May 2002 19:26:47 +0100
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.
--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.