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/