Thread (14 messages) flat view 14 messages, 5 authors, 2016-06-15

Re: [RFC PATCH] Windows: Assume all file names to be UTF-8 encoded.

From: Dmitry Potapov <hidden>
Date: 2016-06-15 22:46:19

On Mon, Mar 02, 2009 at 09:47:22AM +0100, Peter Krefting wrote:
When opening a file through open() or fopen(), the path passed is
UTF-8 encoded. To handle this on Windows, we need to convert the
path string to UTF-16 and use the Unicode-based interface.
IMHO, you grossly underestimate what is needed to enable UTF-8 encoding
in Windows. AFAIK, Microsoft C runtime library does not support UTF-8,
so you have to wrap all C functions taking 'char*' as an input parameter.
For example, think about what is going to happen if Git tries to print
a simple error message:
  fprintf (stderr, "unable to open %s", path);
Since there is no real file system abstraction beyond using stdio_
(AFAIK), I need to hack it by replacing fopen (and open). Probably_
opendir/readdir as well (might be trickier), and possibly even hack_
around main() to parse the wchar_t command-line instead of the char copy.
And the command-line is not the only source of file names. Some Git
commands read list of files from stdin usually though the pipe. In
what encoding are they going to be?

Dmitry
Keyboard shortcuts
hback out one level
jnext message in thread
kprevious message in thread
ldrill in
Escclose help / fold thread tree
?toggle this help