mirror of
https://gitea.wildfiregames.com/0ad/0ad.git
synced 2026-06-21 22:06:33 +00:00
Convert debug_printf to take UTF-8 strings instead of wchar_t.
This fixes the problem where passing a non-ASCII string to debug_printf(L"%hs", s) caused vswprintf_s to fail on Linux (because it doesn't know what encoding the char* is meant to have). Now debug messages will remain as UTF-8 until they reach the OS. Fixes #3021. This was SVN commit r16332.
This commit is contained in:
@@ -150,7 +150,7 @@ bool print(JSContext* cx, uint argc, jsval* vp)
|
||||
std::wstring str;
|
||||
if (!ScriptInterface::FromJSVal(cx, args[i], str))
|
||||
return false;
|
||||
debug_printf(L"%ls", str.c_str());
|
||||
debug_printf("%s", utf8_from_wstring(str).c_str());
|
||||
}
|
||||
fflush(stdout);
|
||||
args.rval().setUndefined();
|
||||
|
||||
Reference in New Issue
Block a user