[OS X Emacs] M-x shell and file names with umlauts

David Reitter david.reitter at gmail.com
Mon Oct 6 19:37:15 EDT 2008

This discussion has cropped up back in 2005, and now again on aquamacs- 
bugs.  Let's solve the mystery.

File names don't appear to be decoded and shown correctly when I do M- 
x shell and then "ls". Interestingly, "ls" just leads to file names  
that are shown as "??", while "ls | cat" shows me something like "Hello 
\314\210" (for Hellö).  If I set the coding system correctly with C-x  
RET p utf-8m RET utf-8m RET, then "ls | cat" begins to work fine, as  
does "ls -w".

  -w      Force raw printing of non-printable characters.  This is the  
default when output is not to
              a terminal.

By the way: it's the same in iTerm.  So, "ls" must be guessing that  
the terminal only processes ASCII.  This bit of communication would go  
via the LANG environment variable, part of a system's locale.  If we  
try to set it to something sensible involving UTF-8:

export LANG=de_DE.UTF-8

then, suddenly, "ls" does the right thing!  I'm not sure what the  
correct setting for the language bit would be - en_US.UTF-8 works just  
as well.

Now, the big question is, what is the right thing to do for Emacs on  
the Mac?
Shouldn't M-x shell set the locale to something sensible, at least the  
LANG variable?  Shouldn't it set the process coding system to UTF-8??

I'd like to get these things right, and people with experience in unix  
architectures may have answers here.

Pedro Gonzales wrote today on aquamacs-bugs:
> when running a shell from within Aquamacs (M-x shell),
> a directory listing (ls -l) won't show properly file names with
> non-ASCII characters

http://aquamacs.org -- Aquamacs: Emacs on Mac OS X
http://aquamacs.org/donate -- Could we help you? Return the favor and  
support the Aquamacs Project!
-------------- next part --------------
A non-text attachment was scrubbed...
Name: smime.p7s
Type: application/pkcs7-signature
Size: 2193 bytes
Desc: not available
URL: <http://email.esm.psu.edu/pipermail/macosx-emacs/attachments/20081006/4043f6b5/attachment.p7s>

More information about the MacOSX-Emacs mailing list