Commit f2c4b9fe authored by Eric Pouech's avatar Eric Pouech Committed by Alexandre Julliard

icinfo: Use OEM code page for output.

parent aebe8453
......@@ -35,17 +35,13 @@ static int WINAPIV mywprintf(const WCHAR *format, ...)
vswprintf(output_bufW, ARRAY_SIZE(output_bufW), format, parms);
va_end(parms);
/* Try to write as unicode whenever we think it's a console */
if (((DWORD_PTR)hout & 3) == 3)
{
res = WriteConsoleW(hout, output_bufW, lstrlenW(output_bufW), &nOut, NULL);
}
else
res = WriteConsoleW(hout, output_bufW, lstrlenW(output_bufW), &nOut, NULL);
if (!res)
{
DWORD convertedChars;
/* Convert to OEM, then output */
convertedChars = WideCharToMultiByte(GetConsoleOutputCP(), 0, output_bufW, -1,
convertedChars = WideCharToMultiByte(GetOEMCP(), 0, output_bufW, -1,
output_bufA, sizeof(output_bufA),
NULL, NULL);
res = WriteFile(hout, output_bufA, convertedChars, &nOut, FALSE);
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment