icinfo: Use OEM code page for output.
Signed-off-by: Eric Pouech <eric.pouech@gmail.com> Signed-off-by: Alexandre Julliard <julliard@winehq.org>
This commit is contained in:
parent
aebe845316
commit
f2c4b9fe07
|
@ -35,17 +35,13 @@ static int WINAPIV mywprintf(const WCHAR *format, ...)
|
||||||
vswprintf(output_bufW, ARRAY_SIZE(output_bufW), format, parms);
|
vswprintf(output_bufW, ARRAY_SIZE(output_bufW), format, parms);
|
||||||
va_end(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);
|
res = WriteConsoleW(hout, output_bufW, lstrlenW(output_bufW), &nOut, NULL);
|
||||||
}
|
if (!res)
|
||||||
else
|
|
||||||
{
|
{
|
||||||
DWORD convertedChars;
|
DWORD convertedChars;
|
||||||
|
|
||||||
/* Convert to OEM, then output */
|
/* Convert to OEM, then output */
|
||||||
convertedChars = WideCharToMultiByte(GetConsoleOutputCP(), 0, output_bufW, -1,
|
convertedChars = WideCharToMultiByte(GetOEMCP(), 0, output_bufW, -1,
|
||||||
output_bufA, sizeof(output_bufA),
|
output_bufA, sizeof(output_bufA),
|
||||||
NULL, NULL);
|
NULL, NULL);
|
||||||
res = WriteFile(hout, output_bufA, convertedChars, &nOut, FALSE);
|
res = WriteFile(hout, output_bufA, convertedChars, &nOut, FALSE);
|
||||||
|
|
Loading…
Reference in New Issue