mirror of
https://gitea.wildfiregames.com/0ad/0ad.git
synced 2026-11-08 23:51:54 +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:
1 parent
bf4b8bfe9c
commit
e06a7b37d8
68 files changed
+232
-229
No files matched your search
@@ -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