Re: [RFC PATCH] Windows: Assume all file names to be UTF-8 encoded.
- From
Dmitry Potapov <dpotapov@gmail.com>
- Date
- Mar 3, 2009, 21:02 UTC
- Message-ID
- <37fcd2780903031302m5f98fe71u8bdb23f90a8df82a@mail.gmail.com>
- In-Reply-To
- <450196A1AAAE4B42A00A8B27A59278E709F077AC@EXCHANGE.trad.tradestation.com>
On Tue, Mar 3, 2009 at 11:39 PM, John Dlugosz <JDlugosz@tradestation.com> wrote:
Show 9 quoted lines
> > Now, the default when a program starts is to use the "C" locale. The > locale argument to setlocale can take a form ".code_page", so calling > > setlocale (LC_CTYPE, ".65001"); > > should do the trick. Assuming, that is, that you don't hit macros that > assume that characters are never multibyte. So define the preprocessor > symbol _MBCS when you compile.
If Microsoft fixed the problem with UTF-8 support in C runtime, it is a really good news, because setlocale did not work not so long time ago:
http://blogs.msdn.com/michkap/archive/2006/03/13/550191.aspx
As to Win32 API, it has always worked correctly with UTF-8... In fact, the documentation of GetOEMCP function goes as far as recommending to use UTF-8 or UTF-16: "For the most consistent results, applications should use Unicode, such as UTF-8 or UTF-16, instead of a specific code page.
So it would be great if Git supported UTF-8 on Windows (as an option), but it is not my itch right now....
Dmitry