1
0
forked from mirrors/0ad

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:
Ykkrosh
2015-02-14 01:49:34 +00:00
parent e06a7b37d8
commit bb9de80dd4
13 changed files with 38 additions and 117 deletions
+2 -2
View File
@@ -176,7 +176,7 @@ size_t CSimulationMessage::GetSerializedLength() const
CStr CSimulationMessage::ToString() const
{
std::string source = utf8_from_wstring(m_ScriptInterface->ToString(const_cast<JS::PersistentRootedValue*>(&m_Data)));
std::string source = m_ScriptInterface->ToString(const_cast<JS::PersistentRootedValue*>(&m_Data));
std::stringstream stream;
stream << "CSimulationMessage { m_Client: " << m_Client << ", m_Player: " << m_Player << ", m_Turn: " << m_Turn << ", m_Data: " << source << " }";
@@ -223,7 +223,7 @@ size_t CGameSetupMessage::GetSerializedLength() const
CStr CGameSetupMessage::ToString() const
{
std::string source = utf8_from_wstring(m_ScriptInterface.ToString(const_cast<JS::PersistentRootedValue*>(&m_Data)));
std::string source = m_ScriptInterface.ToString(const_cast<JS::PersistentRootedValue*>(&m_Data));
std::stringstream stream;
stream << "CGameSetupMessage { m_Data: " << source << " }";