mirror of
https://github.com/hrydgard/ppsspp.git
synced 2025-02-01 03:03:40 +00:00
Convert the title to wchars to fix non-ASCII.
This commit is contained in:
parent
20d05b8dc9
commit
ad59c7f46d
@ -40,7 +40,27 @@ void WindowsHost::SetWindowTitle(const char *message)
|
||||
// Really need a better way to deal with versions.
|
||||
std::string title = "PPSSPP v0.4 - ";
|
||||
title += message;
|
||||
SetWindowText(mainWindow_, title.c_str());
|
||||
|
||||
int size = MultiByteToWideChar(CP_UTF8, 0, message, title.size(), NULL, 0);
|
||||
if (size > 0)
|
||||
{
|
||||
wchar_t *utf16_title = new wchar_t[size + 1];
|
||||
if (utf16_title)
|
||||
size = MultiByteToWideChar(CP_UTF8, 0, message, title.size(), utf16_title, size);
|
||||
else
|
||||
size = 0;
|
||||
|
||||
if (size > 0)
|
||||
{
|
||||
utf16_title[size] = 0;
|
||||
SetWindowTextW(mainWindow_, utf16_title);
|
||||
delete[] utf16_title;
|
||||
}
|
||||
}
|
||||
|
||||
// Something went wrong, fall back to using the local codepage.
|
||||
if (size <= 0)
|
||||
SetWindowTextA(mainWindow_, title.c_str());
|
||||
}
|
||||
|
||||
void WindowsHost::InitSound(PMixer *mixer)
|
||||
|
Loading…
x
Reference in New Issue
Block a user