mirror of
https://gitea.wildfiregames.com/0ad/0ad.git
synced 2026-06-26 16:25:57 +00:00
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:
@@ -237,8 +237,13 @@ public:
|
||||
template<typename CHAR> bool Eval(const CHAR* code, JS::MutableHandleValue out);
|
||||
template<typename T, typename CHAR> bool Eval(const CHAR* code, T& out);
|
||||
|
||||
// We have to use a mutable handle because JS_Stringify requires that for unknown reasons.
|
||||
std::wstring ToString(JS::MutableHandleValue obj, bool pretty = false);
|
||||
/**
|
||||
* Convert an object to a UTF-8 encoded string, either with JSON
|
||||
* (if pretty == true and there is no JSON error) or with toSource().
|
||||
*
|
||||
* We have to use a mutable handle because JS_Stringify requires that for unknown reasons.
|
||||
*/
|
||||
std::string ToString(JS::MutableHandleValue obj, bool pretty = false);
|
||||
|
||||
/**
|
||||
* Parse a UTF-8-encoded JSON string. Returns the unmodified value on error
|
||||
|
||||
Reference in New Issue
Block a user