mirror of
https://gitea.wildfiregames.com/0ad/0ad.git
synced 2026-07-28 11:12:37 +00:00
Convert CConsole to take UTF-8 strings.
This avoids vswprintf failures when printing non-ASCII char* strings from CLogger into the console. Also convert ScriptInterface::ToString to return UTF-8, to avoid some utf8_from_wstring calls. Also remove some unused and redundant CConsole functions. This was SVN commit r16333.
This commit is contained in:
@@ -196,19 +196,19 @@ void CNetClient::PushGuiMessage(const JS::HandleValue message)
|
||||
m_GuiMessageQueue.push_back(JS::Heap<JS::Value>(message));
|
||||
}
|
||||
|
||||
std::wstring CNetClient::TestReadGuiMessages()
|
||||
std::string CNetClient::TestReadGuiMessages()
|
||||
{
|
||||
JSContext* cx = GetScriptInterface().GetContext();
|
||||
JSAutoRequest rq(cx);
|
||||
|
||||
std::wstring r;
|
||||
std::string r;
|
||||
JS::RootedValue msg(cx);
|
||||
while (true)
|
||||
{
|
||||
GuiPoll(&msg);
|
||||
if (msg.isUndefined())
|
||||
break;
|
||||
r += GetScriptInterface().ToString(&msg) + L"\n";
|
||||
r += GetScriptInterface().ToString(&msg) + "\n";
|
||||
}
|
||||
return r;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user