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

Re: Moving a directory into another fails

From
Johannes Schindelin <johannes.schindelin@gmx.de>
Date
Dec 4, 2006, 21:01 UTC
Message-ID
<Pine.LNX.4.63.0612042155480.28348@wbgn013.biozentrum.uni-wuerzburg.de>
In-Reply-To
<7617FA7E-D49A-4A4C-B033-C2CB20623F5F@wf227.com>
Hi,

thank you, Wolfgang, for back Cc'ing me (Jakub never does that...), but I am Cc'ing the git list here, also. Hope both of you don't mind.

On Mon, 4 Dec 2006, Wolfgang Fischer wrote:
Show 20 quoted lines
> On 04.12.2006, at 20:37, Jakub Narebski wrote:
> 
> > And HFS+ is on MacOS X / Darwin, without iconv in libc...
> 
> And, what is even worse, is the fact that HFS+ uses an encoding, which is not
> represented in libiconv.
> 
> If you CREATE a file, you can use UTF8-NFC 
> (Normalization-Form-Composed), but if you later READDIR a directory, you 
> will get the very same name back in the encoding used by HFS+, which is 
> UTF8-NFD Normalization-Form-Decomposed. The difference is noticeable for 
> some non-ASCII characters like e.g.
> 
> LATIN SMALL LETTER A WITH DIAERESIS  U+00E4 or U+0061 U+0308 in Unicode.
> 
> If you need a sane backward mapping, one has to use some CoreFoundation 
> interface, for which I removed the details out of my brain, in order to 
> reclaim that memory area (garbage collection!). But I can help you with 
> some details and probably code, if you really need that conversion 
> direction.

Yes. When my iBook was still alive, I saw that problem, too: writing and reading filenames were completely different issues.

Worse, you can experience the same on USB-Sticks when accessing them with different OSes. For example, when checking out a git repo on a stick with Linux, and then calling git-status on the same stick with Windows XP, you see an issue with the file "Märchen", like you did on MacOSX.

So, please, please, please do not try to be smart about filename encodings in git, but just DO NOT USE ANYTHING BUT ASCII IN FILENAMES IF THE REPOSITORY IS GOING TO BE PUT ON DIFFERENT OPERATING SYSTEMS/FILE SYSTEMS. (Wow, the Caps Lock key is _not_ dead after all. I must have been infected by Linus...)

Ciao, Dscho

Previous: Linus Torvalds
Message 24 of 24 in “Moving a directory into another fails”
  1. Jon SmirlJul 26, 2006
  2. Nicolas VilzJul 26, 2006
  3. Jon SmirlJul 26, 2006
  4. Nicolas VilzJul 26, 2006
  5. Petr BaudisJul 28, 2006
  6. Stefan PfetzingDec 4, 2006
  7. Jakub NarebskiDec 4, 2006
  8. Johannes SchindelinDec 4, 2006
  9. Jakub NarebskiDec 4, 2006
  10. Johannes SchindelinDec 4, 2006
  11. Jakub NarebskiDec 4, 2006
  12. Linus TorvaldsDec 4, 2006
  13. Linus TorvaldsDec 4, 2006
  14. Shawn PearceDec 4, 2006
  15. Jakub NarebskiDec 4, 2006
  16. Johannes SchindelinDec 4, 2006
  17. Linus TorvaldsDec 4, 2006
  18. Johannes SchindelinDec 5, 2006
  19. Jakub NarebskiDec 5, 2006
  20. filesystem encodings and gitweb tests, was Re: Moving a directory into another failsJohannes Schindelin, Dec 5, 2006
  21. Jakub NarebskiDec 5, 2006
  22. Johannes SchindelinDec 5, 2006
  23. Linus TorvaldsDec 5, 2006
  24. Johannes SchindelinDec 4, 2006

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.