Another attempt at string encoding for JS inside a PDF.
Fixes https://gitlab.com/kicad/code/kicad/issues/12782
This commit is contained in:
@@ -196,7 +196,14 @@ wxString EscapeString( const wxString& aSource, ESCAPE_CONTEXT aContext )
|
||||
}
|
||||
else if( aContext == CTX_JS_STR )
|
||||
{
|
||||
if( c == '\'' )
|
||||
if( c >= 0x7F )
|
||||
{
|
||||
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}" );
|
||||
|
||||
Reference in New Issue
Block a user