Subject: Re: OS X and umlauts in file names

From: Thomas Singer <[email-masked]>
Date: Wed, 25 Nov 2009 09:50:18 +0100

I've did following:

 toms-mac-mini:git-umlauts tom$ ls
 Überlänge.txt
 toms-mac-mini:git-umlauts tom$ git status
 # On branch master
 #
 # Initial commit
 #
 # Changes to be committed:
 #   (use "git rm --cached <file>..." to unstage)
 #
  #	new file:   "U\314\210berla\314\210nge.txt"
 #
 toms-mac-mini:git-umlauts tom$ git stage "U\314\210berla\314\210nge.txt"
 fatal: pathspec 'U\314\210berla\314\210nge.txt' did not match any files

Note, that I copy-pasted the file name which 'git status' showed to the
stage command. IMHO, this should work, especially, because different people
said Git would treat the file name as byte-array without interpreting it in
some kind.

From the user with the German OS X (for which the staging is said to work),
I've got the output of 'env' and hence also tried

 export LANG=de_DE.UTF-8

before doing the above steps, but with the same results. :(

-- 
Tom

Daniel Barkalow wrote:
> On Mon, 23 Nov 2009, Thomas Singer wrote:
> 
>> I'm on an English OS X 10.6.2 and I created a sample file with umlauts in
>> its name (Überlänge.txt). When I try to stage the file in the terminal, I
>> can't complete the file name by typing the Ü and hitting the tab key, but I
>> can complete it by typing an U and hitting the tab key.
> 
> You've already got a bug before involving git at all. You create a 
> file "Überlänge.txt", but OS X writes "U:berla:nge.txt" (typing the 
> combining character umlaut as : so that you can see the difference), and 
> the directory listing doesn't contain any files that start with Ü, so the 
> terminal already can't find the file you created. Obviously, git is going 
> to have all the problems that the OS-provided readline library has, and 
> you're not going to be able to get predictable results in any case where 
> user-supplied filenames are compared with directory listings.
> 
> Part of the problem is that OS X does a canonicalization that is not what 
> anybody else does, so you hit the problem every single time, but the 
> fundamental issue is that there isn't any way to tell, when you create a 
> file, what name that file will be listed under.
> 
> Note that this isn't a matter of characters to byte sequences. OS X 
> actually uses different characters for the filename in its listings than 
> you've used.
> 
> If there's a difference between German and English versions, I suspect 
> that it's actually that you're not using a German keyboard with a key 
> that, under OS X, produces the two-character sequence U:, but using some 
> method that produces the single character Ü. I'd guess that your SmartGit 
> problem is that Java is converting the U: that the user typed into Ü, and 
> passing it to the OS, which turns it back into U: and then doesn't list 
> the file that Java thinks the user asked for.
> 
> 	-Daniel
> *This .sig left intentionally blank*