Re: Posix path and High Ascii Characters
Re: Posix path and High Ascii Characters
- Subject: Re: Posix path and High Ascii Characters
- From: alain content <email@hidden>
- Date: Tue, 10 Sep 2002 01:46:51 +0200
>
Did that make any sense, or is everyone thoroughly confused now?
Chris,
I, for one, am a bit confused...sorry to be longish:
1. you wrote
>
Actually, the problem is with "do shell script", not "POSIX path". It
>
doesn't understand the proper text encoding to use with shell commands.
>
The simplest solution is to upgrade to 10.2 Jaguar, which fixes the
>
bug. Failing that, a technique has been described here a few times to
>
mangle the path into UTF-8 by hand.
Under 10.2, do shell script still fails when the path contains high asciis,
e.g.
do shell script "cd '~/Desktop/photos e'te''" or
do shell script quoted form of "cd ~/Desktop/photos e'te'" or
Both return an error (sh: cd ~/Desktop/photos e'te' : no such file or
directory)
However, the following seems to work :
set thePath to POSIX path of "U:Users:ac:Desktop:photos e'te'"
do shell script "cd " & quoted form of thePath & ";pwd"
-- "/Users/ac/Desktop/photos e'te'
2. None of these work when talking with Terminal, unfortunately :
set thePath to POSIX path of "U:Users:ac:Desktop:photos e'te'"
tell application "Terminal"
activate
do script "cd " & quoted form of thePath in window frontmost
end tell
Or
tell ...
do script ("echo " & quoted form of thePath) in window frontmost
3. A solution :
I found that if the Emulation -Escape 8bit chars with Ctrl-V option in the
window settings is selected, the following hack works fine :
set thePath to POSIX path of "U:Users:ac:Desktop:photos e'te'"
tell application "Terminal"
activate
do script "set thePath=`echo " & quoted form of thePath & "`; cd
\"$thePath\"" in window frontmost
end tell
4. You wrote:
>
-- the proper UTF-8 sequence for an e-acute is {101, 204, 129}.
Now, this is just plain curiosity, but
what's the relation between that and what I'm seeing -- e\314\201 --
(except that perhaps 101 is 0065, hence the "e" ?)
Why is it that the very same folder seems to receive two different
names/encodings in Terminal ?
Let me explain:
When using the file completion props of tcsh to change dir, I get to
~/Desktop/photos e\314\201te\314\201
However, using the trick mentioned above,
~/Desktop/photos \303\251t\303\251
5. Footnote :
Finally, let me correct, as the famous Hercule Poirot :
"Frenchman? No Sir, Belgian!"
Thanks !
_______________________________________________
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.