Re: do shell script non-ASCII
Re: do shell script non-ASCII
- Subject: Re: do shell script non-ASCII
- From: Adrian <email@hidden>
- Date: Sat, 25 May 2002 15:58:08 -0400
There is another solution. There is a "Unicode OSAX" (that's what it's
called) which can convert between Unicode number and Unicode character.
-- Adrian
On Wednesday, May 22, 2002, at 03:28 PM, Paul Berkowitz wrote:
On 5/22/02 11:26 AM, "Christopher Nebel" <email@hidden> 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.
Thanks very much, Chris. The best workaround for the moment, as
suggested by
Bill Fancher, was to copy the contents of a file to a new temporary one
with
an ASCII name, move it by the Finder to a directory location I can
specify
by 'path to' to do what needs doing (in my case writing modified text
to a
new file in the same temporary location), then move the files back to
where
they were.
It was fun using 'move' to move, even on another disk, without having to
delete anything. So I saved a few lines back again.
--
Paul Berkowitz
_______________________________________________
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.
_______________________________________________
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.