M-x shell and file names with umlauts

View: New views
1 Messages — Rating Filter:   Alert me  

M-x shell and file names with umlauts

by davidswelt :: Rate this Message:

Reply to Author | View Threaded | Show Only this Message

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!

-------------------------------------------------------------------------
This SF.Net email is sponsored by the Moblin Your Move Developer's challenge
Build the coolest Linux based applications with Moblin SDK & win great prizes
Grand prize is a trip for two to an Open Source event anywhere in the world
http://moblin-contest.org/redirect.php?banner_id=100&url=/
_______________________________________________
Aquamacs-devel mailing list
Aquamacs-devel@...
https://lists.sourceforge.net/lists/listinfo/aquamacs-devel

smime.p7s (2K) Download Attachment
LightInTheBox - Buy quality products at wholesale price!