mirror of
https://github.com/git/git.git
synced 2026-02-10 17:57:23 +00:00
Win32: sync Unicode console output and file system
Use the same Unicode conversion functions for file names and console conversions so that the file system and console output are in sync when checking out legacy encoded repositories (i.e. with invalid UTF-8 file names). Signed-off-by: Karsten Blees <blees@dcon.de>
This commit is contained in:
committed by
Johannes Schindelin
parent
eaeb0a590a
commit
0cefe13839
@@ -120,8 +120,7 @@ static void write_console(unsigned char *str, size_t len)
|
||||
static wchar_t wbuf[2 * BUFFER_SIZE + 1];
|
||||
|
||||
/* convert utf-8 to utf-16 */
|
||||
int wlen = MultiByteToWideChar(CP_UTF8, 0, (char*) str, len, wbuf,
|
||||
ARRAY_SIZE(wbuf));
|
||||
int wlen = xutftowcsn(wbuf, (char*) str, ARRAY_SIZE(wbuf), len);
|
||||
|
||||
/* write directly to console */
|
||||
WriteConsoleW(console, wbuf, wlen, NULL, NULL);
|
||||
|
||||
Reference in New Issue
Block a user