CSV escaping.

This commit is contained in:
Jeff Young 2022-07-24 20:51:09 +01:00
parent 1bad72f14f
commit 582c133835
2 changed files with 10 additions and 0 deletions

View File

@ -245,6 +245,15 @@ wxString EscapeString( const wxString& aSource, ESCAPE_CONTEXT aContext )
else
converted += c;
}
else if( aContext == CTX_CSV )
{
if( c == ',' )
converted += wxT( "{comma}" );
else if( c == '\n' || c == '\r' )
converted += wxT( "{return}" );
else
converted += c;
}
else
{
converted += c;

View File

@ -56,6 +56,7 @@ enum ESCAPE_CONTEXT
CTX_IPC,
CTX_QUOTED_STR,
CTX_LINE,
CTX_CSV,
CTX_FILENAME,
CTX_NO_SPACE // to replace spaces in names that do not accept spaces
};