[PATCH] [cmd]: use correct codepage when outputing unicode text to an ANSI stream

Eric Pouech eric.pouech at orange.fr
Tue May 13 15:02:12 CDT 2008


Vitaliy Margolen a écrit :
> Eric Pouech wrote:
>   
>> @@ -1437,7 +1437,7 @@ static void WCMD_output_asis_len(const WCHAR *message, int len, HANDLE device) {
>>          }
>>  
>>          /* Convert to OEM, then output */
>> -        convertedChars = WideCharToMultiByte(GetConsoleOutputCP(), 0, message,
>> +        convertedChars = WideCharToMultiByte(CP_UNIXCP, 0, message,
>>                              len, output_bufA, MAX_WRITECONSOLE_SIZE,
>>                              "?", &usedDefaultChar);
>>          WriteFile(device, output_bufA, convertedChars,
>>
>>
>>     
> This doesn't look right. What if it's wineconsole with user backend 
> (default) and OEM CP (which is different then UNIXCP)? Should probably hack 
> GetConsoleOutputCP() instead.
>   
this code is only used when no wineconsole is attached, so unixcp is the 
right choice
however, it can be considered that GetConsoleOutputCP() should be 
changed to return the unixcp and not the oem cp when no console is attached
A+

-- 
Eric Pouech
"The problem with designing something completely foolproof is to underestimate the ingenuity of a complete idiot." (Douglas Adams)





More information about the wine-devel mailing list