38#include <fmt/chrono.h>
60 wxString filtered_fullpath = aFullFilename;
65 filtered_fullpath.Replace(
"/",
"_" );
66 filtered_fullpath.Replace(
"\\",
"_" );
69 if( filtered_fullpath.Length() > 1 && filtered_fullpath[1] ==
':' )
70 filtered_fullpath[1] =
' ';
73 if( wxString::npos != filtered_fullpath.find_first_of( wxFileName::GetForbiddenChars() ) )
83 bool inOverbar =
false;
86 if( aOldStr == wxT(
"~" ) )
89 newStr.reserve( aOldStr.length() );
91 for( wxString::const_iterator chIt = aOldStr.begin(); chIt != aOldStr.end(); ++chIt )
95 wxString::const_iterator lookahead = chIt + 1;
97 if( lookahead != aOldStr.end() && *lookahead ==
'~' )
99 if( ++lookahead != aOldStr.end() && *lookahead ==
'{' )
103 newStr << wxT(
"~~{}" );
108 newStr << wxT(
"~" );
112 else if( lookahead != aOldStr.end() && *lookahead ==
'{' )
122 newStr << wxT(
"}" );
127 newStr << wxT(
"~{" );
134 else if( ( *chIt ==
' ' || *chIt ==
'}' || *chIt ==
')' ) && inOverbar )
137 newStr << wxT(
"}" );
146 newStr << wxT(
"}" );
156 for( wxString::iterator ii = aString->begin(); ii != aString->end(); ++ii )
158 if( *ii == L
'\u00B4' || *ii == L
'\u2018' || *ii == L
'\u2019' )
163 if( *ii == L
'\u201C' || *ii == L
'\u201D' )
168 if( *ii == L
'\u2013' || *ii == L
'\u2014' )
182 std::vector<bool> braceStack;
184 converted.reserve( aSource.length() );
186 for( wxUniChar c: aSource )
191 converted += wxT(
"{slash}" );
192 else if( c ==
'\n' || c ==
'\r' )
193 converted += wxEmptyString;
201 converted += wxT(
"{slash}" );
203 converted += wxT(
"{backslash}" );
205 converted += wxT(
"{lt}" );
207 converted += wxT(
"{gt}" );
209 converted += wxT(
"{colon}" );
211 converted += wxT(
"{dblquote}" );
212 else if( c ==
'\n' || c ==
'\r' )
213 converted += wxEmptyString;
220 converted += wxT(
"{slash}" );
222 converted += wxT(
"{comma}" );
224 converted += wxT(
"{dblquote}" );
231 converted += wxT(
"{dblquote}" );
237 if( c >= 0x7F || c ==
'\'' || c ==
'\\' || c ==
'(' || c ==
')' )
239 unsigned int code = c;
241 snprintf( buffer,
sizeof(buffer),
"\\u%4.4X", code );
251 if( c ==
'\n' || c ==
'\r' )
252 converted += wxT(
"{return}" );
259 converted += wxT(
"{slash}" );
261 converted += wxT(
"{backslash}" );
263 converted += wxT(
"{dblquote}" );
265 converted += wxT(
"{lt}" );
267 converted += wxT(
"{gt}" );
269 converted += wxT(
"{bar}" );
271 converted += wxT(
"{colon}" );
273 converted += wxT(
"{tab}" );
274 else if( c ==
'\n' || c ==
'\r' )
275 converted += wxT(
"{return}" );
282 converted += wxT(
"{space}" );
289 converted += wxT(
"{comma}" );
290 else if( c ==
'\n' || c ==
'\r' )
291 converted += wxT(
"{return}" );
307 size_t sourceLen = aSource.length();
316 newbuf.reserve( sourceLen );
321 for(
size_t i = 0; i < sourceLen; ++i )
330 bool terminated =
false;
332 for( i = i + 1; i < sourceLen; ++i )
356 else if( prev ==
'$' || prev ==
'~' || prev ==
'^' || prev ==
'_' )
360 else if( token == wxT(
"dblquote" ) ) newbuf << wxT(
"\"" );
361 else if( token == wxT(
"quote" ) ) newbuf << wxT(
"'" );
362 else if( token == wxT(
"lt" ) ) newbuf << wxT(
"<" );
363 else if( token == wxT(
"gt" ) ) newbuf << wxT(
">" );
364 else if( token == wxT(
"backslash" ) ) newbuf << wxT(
"\\" );
365 else if( token == wxT(
"slash" ) ) newbuf << wxT(
"/" );
366 else if( token == wxT(
"bar" ) ) newbuf << wxT(
"|" );
367 else if( token == wxT(
"comma" ) ) newbuf << wxT(
"," );
368 else if( token == wxT(
"colon" ) ) newbuf << wxT(
":" );
369 else if( token == wxT(
"space" ) ) newbuf << wxT(
" " );
370 else if( token == wxT(
"dollar" ) ) newbuf << wxT(
"$" );
371 else if( token == wxT(
"tab" ) ) newbuf << wxT(
"\t" );
372 else if( token == wxT(
"return" ) ) newbuf << wxT(
"\n" );
373 else if( token == wxT(
"brace" ) ) newbuf << wxT(
"{" );
396 result.reserve( aString.length() );
398 for(
const wxString& word : words )
400 if( !result.IsEmpty() )
401 result += wxT(
" " );
403 result += word.Capitalize();
417 result.reserve( aString.length() );
419 for(
const wxString& word : words )
421 if( result.IsEmpty() )
422 result += word.Capitalize();
424 result += wxT(
" " ) + word.Lower();
435 const char* start = aSource;
438 while( (cc = *aSource++) != 0 )
458 if( cc !=
'"' && cc !=
'\\' )
472 return aSource - start;
482 const char* start = aSource;
483 char* limit = aDest + aDestSize - 1;
486 while( ( cc = *aSource++ ) != 0 && aDest < limit )
505 if( cc !=
'"' && cc !=
'\\' )
520 return aSource - start;
526 wxString str = aString;
529 str.Replace( wxT(
"\r\n" ), wxT(
"\r" ) );
530 str.Replace( wxT(
"\n" ), wxT(
"\r" ) );
532 std::string utf8 =
TO_UTF8( aString );
536 ret.reserve( utf8.length() + 2 );
540 for( std::string::const_iterator it = utf8.begin(); it!=utf8.end(); ++it )
548 else if( *it ==
'\\' )
569 converted.reserve( aString.length() );
571 for( wxUniChar c : aString )
574 converted += wxT(
""" );
576 converted += wxT(
"'" );
578 converted += wxT(
"&" );
580 converted += wxT(
"<" );
582 converted += wxT(
">" );
594 static const std::map<wxString, wxString> c_replacements = {
595 { wxS(
"quot" ), wxS(
"\"" ) },
596 { wxS(
"apos" ), wxS(
"'" ) },
597 { wxS(
"amp" ), wxS(
"&" ) },
598 { wxS(
"lt" ), wxS(
"<" ) },
599 { wxS(
"gt" ), wxS(
">" ) }
604 wxString regexStr =
"&(#(\\d*)|#x([a-zA-Z0-9]{4})";
606 for(
auto& [key, value] : c_replacements )
607 regexStr <<
'|' << key;
611 wxRegEx regex( regexStr );
618 wxString str = aString;
620 while( regex.Matches( str ) )
622 std::vector<wxString> matches;
623 regex.GetMatch( &start, &len );
625 result << str.Left( start );
627 wxString code = regex.GetMatch( str, 1 );
628 wxString codeDec = regex.GetMatch( str, 2 );
629 wxString codeHex = regex.GetMatch( str, 3 );
631 if( !codeDec.IsEmpty() || !codeHex.IsEmpty() )
633 unsigned long codeVal = 0;
635 if( !codeDec.IsEmpty() )
636 codeDec.ToCULong( &codeVal );
637 else if( !codeHex.IsEmpty() )
638 codeHex.ToCULong( &codeVal, 16 );
641 result << wxUniChar( codeVal );
643 else if(
auto val =
get_opt( c_replacements, code ) )
648 str = str.Mid( start + len );
659 wxString str = aInput;
660 wxRegEx( wxS(
"<[^>]*>" ) ).ReplaceAll( &str, wxEmptyString );
668 static wxRegEx regex( wxS(
"\\b(https?|ftp|file)://([-\\w+&@#/%?=~|!:,.;]*[^.,:;<>\\(\\)\\s\u00b6])" ),
671 regex.ReplaceAll( &aStr,
"<a href=\"\\0\">\\0</a>" );
679 static wxRegEx regex( wxS(
"(https?|ftp|file)://([-\\w+&@#/%?=~|!:,.;]*[^.,:;<>\\s\u00b6])" ),
682 regex.ReplaceAll( &aStr,
"<a href=\"\\0\">\\0</a>" );
684 return regex.Matches( aStr );
690 wxString tmp = aString;
692 return tmp.Trim(
true ).Trim(
false ).IsEmpty();
699 int overbarDepth = -1;
700 int superSubDepth = -1;
701 int braceNesting = 0;
703 for(
auto chIt = aString.begin(),
end = aString.end(); chIt <
end; ++chIt )
711 else if( *chIt ==
'^' && superSubDepth == -1 )
713 auto lookahead = chIt;
715 if( ++lookahead !=
end && *lookahead ==
'{' )
718 superSubDepth = braceNesting;
723 else if( *chIt ==
'_' && superSubDepth == -1 )
725 auto lookahead = chIt;
727 if( ++lookahead !=
end && *lookahead ==
'{' )
730 superSubDepth = braceNesting;
735 else if( *chIt ==
'~' && overbarDepth == -1 )
737 auto lookahead = chIt;
739 if( ++lookahead !=
end && *lookahead ==
'{' )
742 overbarDepth = braceNesting;
747 else if( *chIt ==
'{' )
751 else if( *chIt ==
'}' )
753 if( braceNesting > 0 )
756 if( braceNesting == superSubDepth )
762 if( braceNesting == overbarDepth )
778 static const char whitespace[] =
" \t\n\r\f\v";
782 while( *
text && strchr( whitespace, *
text ) )
785 char* cp =
text + strlen(
text ) - 1;
787 while( cp >=
text && strchr( whitespace, *cp ) )
795char*
GetLine( FILE* File,
char* Line,
int* LineNum,
int SizeLine )
798 if( fgets( Line, SizeLine, File ) ==
nullptr )
804 }
while( Line[0] ==
'#' || Line[0] ==
'\n' || Line[0] ==
'\r' || Line[0] == 0 );
806 strtok( Line,
"\n\r" );
817#if defined(__MINGW32__) && !defined(_UCRT)
818 return fmt::format(
"{:%FT%T}", fmt::localtime( std::time(
nullptr ) ) );
820 return fmt::format(
"{:%FT%T%z}", fmt::localtime( std::time(
nullptr ) ) );
825int StrNumCmp(
const wxString& aString1,
const wxString& aString2,
bool aIgnoreCase )
827 int nb1 = 0, nb2 = 0;
829 auto str1 = aString1.begin();
830 auto str2 = aString2.begin();
832 while( str1 != aString1.end() && str2 != aString2.end() )
834 wxUniChar c1 = *str1;
835 wxUniChar c2 = *str2;
837 if( wxIsdigit( c1 ) && wxIsdigit( c2 ) )
845 nb1 = nb1 * 10 + (int) c1 -
'0';
847 }
while( str1 != aString1.end() && wxIsdigit( *str1 ) );
852 nb2 = nb2 * 10 + (int) c2 -
'0';
854 }
while( str2 != aString2.end() && wxIsdigit( *str2 ) );
862 c1 = ( str1 != aString1.end() ) ? *str1 : wxUniChar( 0 );
863 c2 = ( str2 != aString2.end() ) ? *str2 : wxUniChar( 0 );
871 wxUniChar uc1 = wxToupper( c1 );
872 wxUniChar uc2 = wxToupper( c2 );
875 return uc1 < uc2 ? -1 : 1;
887 if( str1 != aString1.end() )
890 if( str2 != aString2.end() )
894 if( str1 == aString1.end() && str2 != aString2.end() )
898 else if( str1 != aString1.end() && str2 == aString2.end() )
908 bool case_sensitive )
910 const wxChar* cp =
nullptr;
911 const wxChar* mp =
nullptr;
912 const wxChar* wild =
nullptr;
913 const wxChar* str =
nullptr;
914 wxString _pattern, _string_to_tst;
918 wild = pattern.GetData();
919 str = string_to_tst.GetData();
924 _pattern.MakeUpper();
925 _string_to_tst = string_to_tst;
926 _string_to_tst.MakeUpper();
927 wild = _pattern.GetData();
928 str = _string_to_tst.GetData();
931 while( ( *str ) && ( *wild !=
'*' ) )
933 if( ( *wild != *str ) && ( *wild !=
'?' ) )
950 else if( ( *wild == *str ) || ( *wild ==
'?' ) )
962 while( *wild ==
'*' )
974 static const wxString modifiers( wxT(
"pnuµμmkKM" ) );
976 if( !aString.length() )
982 if( modifiers.Find( aString[ 0 ] ) >= 0 )
984 modifier = aString[ 0 ];
985 units = aString.Mid( 1 ).Trim();
990 units = aString.Mid( 0 ).Trim();
994 && !units.IsSameAs( wxT(
"F" ),
false )
995 && !units.IsSameAs( wxT(
"hz" ),
false )
996 && !units.IsSameAs( wxT(
"W" ),
false )
997 && !units.IsSameAs( wxT(
"V" ),
false )
998 && !units.IsSameAs( wxT(
"A" ),
false )
999 && !units.IsSameAs( wxT(
"H" ),
false ) )
1004 if( modifier ==
'p' )
1006 if( modifier ==
'n' )
1008 else if( modifier ==
'u' || modifier == wxS(
"µ" )[0] || modifier == wxS(
"μ" )[0] )
1010 else if( modifier ==
'm' )
1012 else if( modifier ==
'k' || modifier ==
'K' )
1014 else if( modifier ==
'M' )
1016 else if( modifier ==
'G' )
1036 value->Replace( wxS(
" " ), wxEmptyString );
1038 wxChar ambiguousSeparator =
'?';
1039 wxChar thousandsSeparator =
'?';
1040 bool thousandsSeparatorFound =
false;
1041 wxChar decimalSeparator =
'?';
1042 bool decimalSeparatorFound =
false;
1045 for(
int ii = (
int) value->length() - 1; ii >= 0; --ii )
1047 wxChar c = value->GetChar( ii );
1049 if( c >=
'0' && c <=
'9' )
1053 else if( c ==
'.' || c ==
',' )
1055 if( decimalSeparator !=
'?' || thousandsSeparator !=
'?' )
1059 if( c == decimalSeparator )
1061 if( thousandsSeparatorFound )
1063 else if( decimalSeparatorFound )
1066 decimalSeparatorFound =
true;
1068 else if( c == thousandsSeparator )
1073 thousandsSeparatorFound =
true;
1076 else if( ambiguousSeparator !=
'?' )
1080 if( c == ambiguousSeparator )
1083 thousandsSeparator = ambiguousSeparator;
1084 thousandsSeparatorFound =
true;
1085 decimalSeparator = c ==
'.' ?
',' :
'.';
1090 decimalSeparator = ambiguousSeparator;
1091 decimalSeparatorFound =
true;
1092 thousandsSeparator = c;
1093 thousandsSeparatorFound =
true;
1105 if( ( ii == 1 && value->GetChar( 0 ) ==
'0' ) || digits != 3 )
1107 decimalSeparator = c;
1108 decimalSeparatorFound =
true;
1109 thousandsSeparator = c ==
'.' ?
',' :
'.';
1113 ambiguousSeparator = c;
1126 if( decimalSeparator ==
'?' && thousandsSeparator ==
'?' )
1128 const struct lconv* lc = localeconv();
1130 decimalSeparator = lc->decimal_point[0];
1131 thousandsSeparator = decimalSeparator ==
'.' ?
',' :
'.';
1135 value->Replace( thousandsSeparator, wxEmptyString );
1136 value->Replace( decimalSeparator,
'.' );
1149 wxString strFWordBeg, strFWordMid, strFWordEnd;
1150 wxString strSWordBeg, strSWordMid, strSWordEnd;
1153 SplitString( fWord, &strFWordBeg, &strFWordMid, &strFWordEnd );
1154 SplitString( sWord, &strSWordBeg, &strSWordMid, &strSWordEnd );
1157 int isEqual = strFWordBeg.CmpNoCase( strSWordBeg );
1163 else if( isEqual < 0 )
1170 double lFirstNumber = 0;
1171 double lSecondNumber = 0;
1172 bool endingIsModifier =
false;
1177 strFWordMid.ToCDouble( &lFirstNumber );
1178 strSWordMid.ToCDouble( &lSecondNumber );
1180 endingIsModifier |=
ApplyModifier( lFirstNumber, strFWordEnd );
1181 endingIsModifier |=
ApplyModifier( lSecondNumber, strSWordEnd );
1183 if( lFirstNumber > lSecondNumber )
1185 else if( lFirstNumber < lSecondNumber )
1188 else if( !endingIsModifier )
1189 return strFWordEnd.CmpNoCase( strSWordEnd );
1198 wxString* strBeginning,
1199 wxString* strDigits,
1202 static const wxString separators( wxT(
".," ) );
1205 strBeginning->Empty();
1210 if( strToSplit.length() == 0 )
1216 for( ii = (strToSplit.length() - 1); ii >= 0; ii-- )
1218 if( wxIsdigit( strToSplit[ii] ) )
1225 *strBeginning = strToSplit;
1230 *strEnd = strToSplit.substr( ii + 1 );
1233 int position = ii + 1;
1235 for( ; ii >= 0; ii-- )
1237 if( !wxIsdigit( strToSplit[ii] ) && separators.Find( strToSplit[ii] ) < 0 )
1243 *strDigits = strToSplit.substr( 0, position );
1249 *strDigits = strToSplit.substr( ii + 1, position - ii - 1 );
1250 *strBeginning = strToSplit.substr( 0, ii + 1 );
1264 int index = aStr.Len() - 1;
1268 const char chr = aStr.GetChar( index );
1270 if( chr <
'0' || chr >
'9' )
1273 number += ( chr -
'0' ) * base;
1290 bool changed =
false;
1292 result.reserve( aName->length() );
1294 for( std::string::iterator it = aName->begin(); it != aName->end(); ++it )
1299 StrPrintf( &result,
"%c", aReplaceChar );
1312 *aName = std::move( result );
1320 bool changed =
false;
1322 result.reserve( aName.Length() );
1325 for( wxString::iterator it = aName.begin(); it != aName.end(); ++it )
1327 if( illWChars.Find( *it ) != wxNOT_FOUND )
1330 result += aReplaceChar;
1332 result += wxString::Format(
"%%%02x", *it );
1343 aName = std::move( result );
1349void wxStringSplit(
const wxString& aText, wxArrayString& aStrings, wxChar aSplitter )
1353 for(
unsigned ii = 0; ii < aText.Length(); ii++ )
1355 if( aText[ii] == aSplitter )
1357 aStrings.Add( tmp );
1366 if( !tmp.IsEmpty() )
1367 aStrings.Add( tmp );
1373 struct lconv* lc = localeconv();
1374 char sep = lc->decimal_point[0];
1375 unsigned sep_pos = aStringValue.Find( sep );
1380 unsigned min_len = sep_pos + aTrailingZeroAllowed + 1;
1382 while( aStringValue.Len() > min_len )
1384 if( aStringValue.Last() ==
'0' )
1385 aStringValue.RemoveLast();
1397 if( aValue != 0.0 && std::fabs( aValue ) <= 0.0001 )
1399 buf = fmt::format(
"{:.16f}", aValue );
1402 while( !buf.empty() && buf[buf.size() - 1] ==
'0' )
1409 if( buf[buf.size() - 1] ==
'.' )
1416 buf = fmt::format(
"{:.10g}", aValue );
1428 if( aValue != 0.0 && std::fabs( aValue ) <= 0.0001 )
1432 len = snprintf( buf,
sizeof( buf ),
"%.16f", aValue );
1434 while( --len > 0 && buf[len] ==
'0' )
1437 if( buf[len] ==
'.' || buf[len] ==
',' )
1446 len = snprintf( buf,
sizeof( buf ),
"%.10g", aValue );
1449 return std::string( buf, len );
1456 wxString line = wxString::FromUTF8( cstring );
1458 if( line.IsEmpty() )
1460 line = wxConvCurrent->cMB2WC( cstring );
1462 if( line.IsEmpty() )
1463 line = wxString::From8BitData( cstring );
1473 wxString line = wxString::FromUTF8( aString );
1475 if( line.IsEmpty() )
1477 line = wxConvCurrent->cMB2WC( aString.c_str() );
1479 if( line.IsEmpty() )
1480 line = wxString::From8BitData( aString.c_str() );
1489 wxString uriPathAndFileName;
1491 wxCHECK( aFileUri.StartsWith( wxS(
"file://" ), &uriPathAndFileName ), aFileUri );
1493 wxString tmp = uriPathAndFileName;
1494 wxString retv = wxS(
"file://" );
1496 tmp.Replace( wxS(
"\\" ), wxS(
"/" ) );
1497 tmp.Replace( wxS(
":" ), wxS(
"" ) );
1499 if( !tmp.IsEmpty() && tmp[0] !=
'/' )
1500 tmp = wxS(
"/" ) + tmp;
This file contains miscellaneous commonly used macros and functions.
std::optional< V > get_opt(const std::map< wxString, V > &aMap, const wxString &aKey)
int StrPrintf(std::string *result, const char *format,...)
This is like sprintf() but the output is appended to a std::string instead of to a character array.
int StrNumCmp(const wxString &aString1, const wxString &aString2, bool aIgnoreCase)
Compare two strings with alphanumerical content.
wxString RemoveHTMLTags(const wxString &aInput)
Removes HTML tags from a string.
wxString EscapeHTML(const wxString &aString)
Return a new wxString escaped for embedding in HTML.
bool WildCompareString(const wxString &pattern, const wxString &string_to_tst, bool case_sensitive)
Compare a string against wild card (* and ?) pattern using the usual rules.
wxString ConvertToNewOverbarNotation(const wxString &aOldStr)
Convert the old ~...~ overbar notation to the new ~{...} one.
int GetTrailingInt(const wxString &aStr)
Gets the trailing int, if any, from a string.
wxString UnescapeString(const wxString &aSource)
static const char illegalFileNameChars[]
Illegal file name characters used to ensure file names will be valid on all supported platforms.
wxString LinkifyHTML(wxString aStr)
Wraps links in HTML tags.
bool convertSeparators(wxString *value)
wxString GetIllegalFileNameWxChars()
wxString From_UTF8(const char *cstring)
bool ConvertSmartQuotesAndDashes(wxString *aString)
Convert curly quotes and em/en dashes to straight quotes and dashes.
void wxStringSplit(const wxString &aText, wxArrayString &aStrings, wxChar aSplitter)
Split aString to a string list separated at aSplitter.
int ReadDelimitedText(wxString *aDest, const char *aSource)
Copy bytes from aSource delimited string segment to aDest wxString.
bool ReplaceIllegalFileNameChars(std::string *aName, int aReplaceChar)
Checks aName for illegal file name characters.
wxString TitleCaps(const wxString &aString)
Capitalize the first letter in each word.
std::string UIDouble2Str(double aValue)
Print a float number without using scientific notation and no trailing 0 We want to avoid scientific ...
std::string FormatDouble2Str(double aValue)
Print a float number without using scientific notation and no trailing 0 This function is intended in...
int PrintableCharCount(const wxString &aString)
Return the number of printable (ie: non-formatting) chars.
std::string EscapedUTF8(const wxString &aString)
Return an 8 bit UTF8 string given aString in Unicode form.
char * GetLine(FILE *File, char *Line, int *LineNum, int SizeLine)
Read one line line from aFile.
bool ApplyModifier(double &value, const wxString &aString)
wxString InitialCaps(const wxString &aString)
Capitalize only the first word.
wxString NormalizeFileUri(const wxString &aFileUri)
Normalize file path aFileUri to URI convention.
wxString EscapeString(const wxString &aSource, ESCAPE_CONTEXT aContext)
The Escape/Unescape routines use HTML-entity-reference-style encoding to handle characters which are:...
wxString GetISO8601CurrentDateTime()
int ValueStringCompare(const wxString &strFWord, const wxString &strSWord)
Compare strings like the strcmp function but handle numbers and modifiers within the string text corr...
int SplitString(const wxString &strToSplit, wxString *strBeginning, wxString *strDigits, wxString *strEnd)
Break a string into three parts: he alphabetic preamble, the numeric part, and any alphabetic ending.
bool IsFullFileNameValid(const wxString &aFullFilename)
Checks if a full filename is valid, i.e.
void StripTrailingZeros(wxString &aStringValue, unsigned aTrailingZeroAllowed)
Remove trailing zeros from a string containing a converted float number.
char * StrPurge(char *text)
Remove leading and training spaces, tabs and end of line chars in text.
bool NoPrintableChars(const wxString &aString)
Return true if the string is empty or contains only whitespace.
wxString UnescapeHTML(const wxString &aString)
Return a new wxString unescaped from HTML format.
bool IsURL(wxString aStr)
Performs a URL sniff-test on a string.
#define TO_UTF8(wxstring)
Convert a wxString to a UTF8 encoded C string for all wxWidgets build modes.
ESCAPE_CONTEXT
Escape/Unescape routines to safely encode reserved-characters in various contexts.