Special characters in folder names?

Has anyone tried this?..

Make a new folder on your Desktop named “Hello•¬” – that’s (Hello ‘option+8’ and ‘option+L’) – . Open a terminal window and type "cd " (with a space after cd) and drag the folder into the termnial window to cd to it. Hit return, it errors with.

~/Desktop/Hello: No such file or directory.

From the terminal, cd to the desktop and list all…

cd /$HOME/desktop; ls -al | more

You should see the “Hello•¬” directory in the output.

Here’e where my question arises…While you’re at the desktop dir in the terminal.app, type

cd Hel --- and hit the tab key for auto-completion. Here's what I see...
cd Hello342200242302254/  --- Which allows you to cd to that folder

What the heck is the “342200242302254” stuff?
“342200242” = ‘option+8’ and “302254” = ‘option+L’, but what is it? Ascii, hex or what? Hiting the delete key in the terminal takes out XXX upon each hit. Just curious.

In a word, Unicode.

Terminal.app uses unicode encoding for its windows, and the digits are how it represents high unicode characters in file names.

Thanks Andrew, how can we put it work in our scripts? I tried using it in a do shell script and a regular tell block to no avail. Have you had any success? Still curious is I…

While I got all of the same results as you using the Terminal, this works on my machine (10.2.8/AS 1.9.1/SE 2B2(v36)) using AS:

No conversion necessary.

I did come across this link which may or may not be helpful. When I converted “Hello•¬” in BBEdit using Zap Gremlins… (all actions selected, replacing with code) I got the hexadecimal conversion “HelloxA5xC2” which the Terminal still didn’t know how to parse.


PS Loving my new PB.

From AppleScript, type Option-8 (or whatever). If you’re using a do shell script, the appropriate translation occurs automagically. See the “non-ASCII” section of Apple’s do shell script in AppleScript technote for a discussion of this and related issues.

If you go to the Terminal and from the “File” menu, select “Show Info” (Command-I), go to “Emulation” pane in the Info window. Under “Input Options”, check “Escape 8-bit chars with Ctrl-V”. Now, when you paste “Hello•¬” into the terminal window, it will automatically convert it to the proper encoded text (“Hello342200242302254”).


hmmm, very interesting.

OT: Congrat’s on the new PB. My trusty ole G4 dually gigabyte ethernet box was unharmed via 10.2.8, phew!!!