git/list[1] front-page[2] threads[3] people[4] search[5] about
 

Re: OS X and umlauts in file names

From
TSThomas Singer <thomas.singer@syntevo.com>
Date
Nov 25, 2009, 08:50 UTC
Message-ID
<4B0CEFCA.5020605@syntevo.com>
In-Reply-To
<alpine.LNX.2.00.0911231403100.14365@iabervon.org>
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*
Previous: Daniel BarkalowNext: B Smith-Mannschott
Message 9 of 20 in “OS X and umlauts in file names”
  1. Thomas SingerNov 23, 2009
  2. Thomas RastNov 23, 2009
  3. Thomas SingerNov 23, 2009
  4. Johannes SchindelinNov 23, 2009
  5. Thomas SingerNov 23, 2009
  6. Jakub NarebskiNov 23, 2009
  7. Martin LanghoffNov 23, 2009
  8. Daniel BarkalowNov 23, 2009
  9. Thomas SingerNov 25, 2009
  10. B Smith-MannschottNov 25, 2009
  11. Martin LanghoffNov 25, 2009
  12. Martin LanghoffNov 25, 2009
  13. Andreas SchwabNov 25, 2009
  14. Thomas SingerNov 26, 2009
  15. Jay SoffianNov 26, 2009
  16. Thomas SingerNov 27, 2009
  17. Thomas SingerNov 27, 2009
  18. Martin LanghoffNov 27, 2009
  19. Thomas SingerNov 27, 2009
  20. Jay SoffianNov 26, 2009

Read the whole thread, see it on lore, or plain text.

$ cat FOOTERMessages come from the public archive at lore.kernel.org/git, fetched every hour. The front page is chosen and written each morning by an AI editor and can be wrong; the threads themselves are the record. About and API. For agents: an MCP server at https://gitlist.dev/mcp, and any thread, story or person page as Markdown by adding .md to its URL (or sending Accept: text/markdown). Details in /llms.txt.