Better Unicode support in the console

This was SVN commit r1038.
This commit is contained in:
Ykkrosh
2004-08-24 11:07:50 +00:00
parent 506b283844
commit 9fa5e3b57a
3 changed files with 36 additions and 17 deletions
+3 -3
View File
@@ -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 );
}