Re: do shell script non-ASCII
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:philip@vcn.b
c.ca
_______________________________________________
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.