diff --git a/common/string_utils.cpp b/common/string_utils.cpp index 54759bd9a5..888ba3f107 100644 --- a/common/string_utils.cpp +++ b/common/string_utils.cpp @@ -196,19 +196,17 @@ wxString EscapeString( const wxString& aSource, ESCAPE_CONTEXT aContext ) } else if( aContext == CTX_JS_STR ) { - if( c >= 0x7F ) + if( c >= 0x7F || c == '\'' || c == '\\' ) { unsigned int code = c; char buffer[16]; sprintf( buffer, "\\\\u%4.4X", code ); converted += buffer; } - else if( c == '\'' ) - converted += wxT( "{quote}" ); - else if( c == '\\' ) - converted += wxT( "{backslash}" ); else + { converted += c; + } } else if( aContext == CTX_LINE ) {