mirror of
https://github.com/git/git.git
synced 2026-02-22 15:51:29 +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
159d35dfe1
commit
b642d4a0f7
@@ -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