mirror of
https://gitea.wildfiregames.com/0ad/0ad.git
synced 2026-09-21 20:06:40 +00:00
Better Unicode support in the console
This was SVN commit r1038.
This commit is contained in:
@@ -85,18 +85,18 @@ JSBool JSI_Console::getConsole( JSContext* cx, JSObject* obj, jsval id, jsval* v
|
||||
JSBool JSI_Console::writeConsole( JSContext* UNUSEDPARAM(context), JSObject* UNUSEDPARAM(globalObject), unsigned int argc, jsval* argv, jsval* UNUSEDPARAM(rval) )
|
||||
{
|
||||
assert( argc >= 1 );
|
||||
CStr output;
|
||||
CStrW output;
|
||||
for( unsigned int i = 0; i < argc; i++ )
|
||||
{
|
||||
try
|
||||
{
|
||||
CStr arg = g_ScriptingHost.ValueToString( argv[0] );
|
||||
CStrW arg = g_ScriptingHost.ValueToUCString( argv[0] );
|
||||
output += arg;
|
||||
}
|
||||
catch( PSERROR_Scripting_ConversionFailed )
|
||||
{
|
||||
}
|
||||
}
|
||||
g_Console->InsertMessage( L"%hs", (const char*)output );
|
||||
g_Console->InsertMessage( L"%ls", output.c_str() );
|
||||
return( JS_TRUE );
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user