At last unicode version of cmd are now output text with right code page

so charater on other langues like swedish, french, ... will display right now

svn path=/trunk/; revision=15052
This commit is contained in:
Magnus Olsen 2005-05-06 17:10:21 +00:00
parent b62466eed1
commit 3f0b1b9276

View file

@ -105,7 +105,7 @@ VOID ConInString (LPTSTR lpInput, DWORD dwLength)
ReadFile (hFile, (PVOID)pBuf, dwLength, &dwRead, NULL);
#ifdef _UNICODE
MultiByteToWideChar(CP_ACP, 0, pBuf, dwLength + 1, lpInput, dwLength + 1);
MultiByteToWideChar( GetConsoleOutputCP(), 0, pBuf, dwLength + 1, lpInput, dwLength + 1);
#endif
p = lpInput;
for (i = 0; i < dwRead; i++, p++)
@ -133,7 +133,7 @@ static VOID ConChar(TCHAR c, DWORD nStdHandle)
WCHAR ws[2];
ws[0] = c;
ws[1] = 0;
WideCharToMultiByte(CP_ACP, 0, ws, 2, as, 2, NULL, NULL);
WideCharToMultiByte( GetConsoleOutputCP(), 0, ws, 2, as, 2, NULL, NULL);
cc = as[0];
#else
cc = c;
@ -159,7 +159,7 @@ VOID ConPuts(LPTSTR szText, DWORD nStdHandle)
len = _tcslen(szText);
#ifdef _UNICODE
pBuf = malloc(len + 1);
len = WideCharToMultiByte(CP_ACP, 0, szText, len + 1, pBuf, len + 1, NULL, NULL) - 1;
len = WideCharToMultiByte( GetConsoleOutputCP(), 0, szText, len + 1, pBuf, len + 1, NULL, NULL) - 1;
#else
pBuf = szText;
#endif
@ -194,7 +194,7 @@ VOID ConPrintf(LPTSTR szFormat, va_list arg_ptr, DWORD nStdHandle)
len = _vstprintf (szOut, szFormat, arg_ptr);
#ifdef _UNICODE
pBuf = malloc(len + 1);
len = WideCharToMultiByte(CP_ACP, 0, szOut, len + 1, pBuf, len + 1, NULL, NULL) - 1;
len = WideCharToMultiByte( GetConsoleOutputCP(), 0, szOut, len + 1, pBuf, len + 1, NULL, NULL) - 1;
#else
pBuf = szOut;
#endif