Use wxASCII_STR() on string literals

Fix the build with wxNO_IMPLICIT_WXSTRING_ENCODING.
This commit is contained in:
Arrigo Marchiori
2019-10-22 12:34:29 +02:00
committed by Vadim Zeitlin
parent 65cbf40b7e
commit c86bcf962d
351 changed files with 965 additions and 950 deletions

View File

@@ -34,7 +34,7 @@ public:
// Note that we use a different name for it for each call to
// RunScript() (which creates a new wxJSScriptWrapper every time) to
// avoid any possible conflict between different calls.
m_outputVarName = wxString::Format("__wxOut%i", (*runScriptCount)++);
m_outputVarName = wxString::Format(wxASCII_STR("__wxOut%i"), (*runScriptCount)++);
// Adds one escape level.
const char *charsNeededToBeEscaped = "\\\"\n\r\v\t\b\f";
@@ -79,8 +79,8 @@ public:
{
return wxString::Format
(
"try { var %s = eval(\"%s\"); true; } "
"catch (e) { e.name + \": \" + e.message; }",
wxASCII_STR("try { var %s = eval(\"%s\"); true; } "
"catch (e) { e.name + \": \" + e.message; }"),
m_outputVarName,
m_escapedCode
);
@@ -93,9 +93,9 @@ public:
#if wxUSE_WEBVIEW && wxUSE_WEBVIEW_WEBKIT && defined(__WXOSX__)
return wxString::Format
(
"if (typeof %s == 'object') JSON.stringify(%s);"
wxASCII_STR("if (typeof %s == 'object') JSON.stringify(%s);"
"else if (typeof %s == 'undefined') 'undefined';"
"else %s;",
"else %s;"),
m_outputVarName,
m_outputVarName,
m_outputVarName,
@@ -104,7 +104,7 @@ public:
#elif wxUSE_WEBVIEW && wxUSE_WEBVIEW_IE
return wxString::Format
(
"try {"
wxASCII_STR("try {"
"(%s == null || typeof %s != 'object') ? String(%s)"
": JSON.stringify(%s);"
"}"
@@ -165,7 +165,7 @@ public:
"__wx$stringifyJSON(%s);"
"}"
"catch (e) { e.name + \": \" + e.message; }"
"}",
"}"),
m_outputVarName,
m_outputVarName,
m_outputVarName,
@@ -183,7 +183,7 @@ public:
// we executed be garbage-collected.
wxString GetCleanUpCode() const
{
return wxString::Format("%s = undefined;", m_outputVarName);
return wxString::Format(wxASCII_STR("%s = undefined;"), m_outputVarName);
}
private: