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

Re: [msysGit] Re: Weird filename encoding issue

From
Peter Krefting <peter@softwolves.pp.se>
Date
Oct 27, 2008, 08:08 UTC
Message-ID
<Pine.LNX.4.64.0810270904490.18631@ds9.cixit.se>
In-Reply-To
<200810180458.53853.robin.rosenberg@gmail.com>
Robin Rosenberg:
> Git (or msys) under windows is somewhat stupid here as it involves
> the eight-bit locale despite running in a unicode OS. To get UTF-8 on
> XP you can set the codepage to UTF-8 (called 65001 in windows).

That presents itself with a lot of other issues, however, as the char-based file APIs were only designed to handle up to double-byte characters. To implement proper Unicode file name support on Windows, one need to use the "wide" APIs (using wchar_t).

Using those APIs, it does not matter what locale the system is set to. Everything is then UTF-16, which is trivially converted to and from UTF-8 (and there are even native APIs to do it if one can't be bothered to write code for it).

I have been meaning to check out a copy of the Msysgit source tree and see how difficult it would be to replace the file API layer with proper Unicode support, but time keeps fleeing from me, so I never seem to get around to :-/

-- 
\\// Peter - http://www.softwolves.pp.se/
Previous: Robin RosenbergNext: Alexander Gladysh
Message 5 of 10 in “Weird filename encoding issue”
  1. Alexander GladyshOct 17, 2008
  2. Alexander GladyshOct 17, 2008
  3. Johannes SixtOct 17, 2008
  4. Robin RosenbergOct 18, 2008
  5. Peter KreftingOct 27, 2008
  6. Alexander GladyshOct 18, 2008
  7. Robin RosenbergOct 18, 2008
  8. Johannes SixtOct 18, 2008
  9. Alexander GladyshOct 19, 2008
  10. Jakub NarebskiOct 17, 2008

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.