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

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
Previous: John DlugoszNext: John Dlugosz
Message 2 of 3 in “Re: [RFC PATCH] Windows: Assume all file names to be UTF-8 encoded.”
  1. John DlugoszMar 3, 2009
  2. Dmitry PotapovMar 3, 2009
  3. John DlugoszMar 3, 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.