mirror of
https://github.com/hrydgard/ppsspp.git
synced 2026-10-01 14:58:14 +00:00
Windows: Fix over/under write for multibyte chars.
This commit is contained in:
1 parent
ed602a3319
commit
dd98e877d4
1 file changed
+2
-1
@@ -136,6 +136,7 @@ void ConsoleListener::Open()
|
||||
// Set the console window title
|
||||
SetConsoleTitle(title_.c_str());
|
||||
SetConsoleCP(CP_UTF8);
|
||||
SetConsoleOutputCP(CP_UTF8);
|
||||
|
||||
// Set letter space
|
||||
LetterSpace(openWidth_, LOG_MAX_DISPLAY_LINES);
|
||||
@@ -503,7 +504,7 @@ void ConsoleListener::WriteToConsole(LogTypes::LOG_LEVELS Level, const char *Tex
|
||||
SetConsoleTextAttribute(hConsole, Color);
|
||||
int wlen = MultiByteToWideChar(CP_UTF8, 0, Text, (int)Len, NULL, NULL);
|
||||
MultiByteToWideChar(CP_UTF8, 0, Text, (int)Len, tempBuf, wlen);
|
||||
WriteConsole(hConsole, tempBuf, (DWORD)Len, &cCharsWritten, NULL);
|
||||
WriteConsole(hConsole, tempBuf, (DWORD)wlen, &cCharsWritten, NULL);
|
||||
}
|
||||
#endif
|
||||
|
||||
|
||||
Reference in new issue
Block a user