Signed-off-by: Eric Pouech eric.pouech@gmail.com
--- programs/attrib/attrib.c | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-)
diff --git a/programs/attrib/attrib.c b/programs/attrib/attrib.c index 4344200b3ec..00c852b24f4 100644 --- a/programs/attrib/attrib.c +++ b/programs/attrib/attrib.c @@ -86,7 +86,8 @@ static int WINAPIV ATTRIB_wprintf(const WCHAR *format, ...) }
/* If writing to console has failed (ever) we assume it's file - i/o so convert to OEM codepage and output */ + * i/o so convert to UTF8 and output + */ if (!res) { BOOL usedDefaultChar = FALSE; DWORD convertedChars; @@ -103,10 +104,10 @@ static int WINAPIV ATTRIB_wprintf(const WCHAR *format, ...) return 0; }
- /* Convert to OEM, then output */ - convertedChars = WideCharToMultiByte(CP_ACP, 0, output_bufW, + /* Convert to UTF8, then output */ + convertedChars = WideCharToMultiByte(CP_UTF8, 0, output_bufW, len, output_bufA, MAX_WRITECONSOLE_SIZE, - "?", &usedDefaultChar); + NULL, &usedDefaultChar); WriteFile(GetStdHandle(STD_OUTPUT_HANDLE), output_bufA, convertedChars, &nOut, FALSE); }