XQuartz, utf-8 and filenames This is a question in the continuation of this one:
UTF8 filenames and shell utilities:
the nightmare of utf-8 and filenames is….

How to avoid this confusion with most notably the ls command on filnames created in the following way:

$ echo $LANG
en_US.UTF-8
$ mkdir test
$ cd test
$ touch á
$ touch a´
$


The first file is created by typing alt ⌥+E, A, the second one by typing A, alt ⌥+shift ⇧+E

Within an xterm window I get:

$ ls -al
total 0
drwxr-xr-x  2 hal  admin   136 Nov 11 15:52 .
drwxr-x---  7 hal  admin  4386 Nov 11 14:25 ..
-rw-r--r--  1 hal  admin     0 Nov 11 15:52 a´
-rw-r--r--  1 hal  admin     0 Nov 11 15:48 a´
$


Which is wrong.

Within a Terminal window I get:

$ ls -al
total 0
drwxr-xr-x  2 hal  admin   136 Nov 11 15:52 .
drwxr-x---  7 hal  admin  4386 Nov 11 14:25 ..
-rw-r--r--  1 hal  admin     0 Nov 11 15:52 a´
-rw-r--r--  1 hal  admin     0 Nov 11 15:48 á
$


Which is right.

The result is the same whichever shell I use: bash or zsh.


What xterm or XQuartz setting will avoid these 2 filenames to falsely look the same?

This problem doesn't exist on Mavericks (MacOS X 10.9).
Okay, finally sorted with the help of this post:


http://lists.apple.com/archives/x11-users/2008/Mar/msg00202.html


In summary, go here:


http://www.rubicode.com/Software/RCEnvironment/


Download the preference pane, and add this entry:

Key=LANG Value=en_GB.UTF-8


I had already added this to my .bashrc and my .profile with no result. But I think XQuartz doesn't launch within that environment, so it never sees it until it is too late.