Use strict UTF-8 conversion in wxSafeConvertXXX() functions
It doesn't make sense to use any fallbacks when converting to/from UTF-8 and this wasn't even done consistently as only wxSafeConvertWX2MB() used MAP_INVALID_UTF8_TO_OCTAL, but not wxSafeConvertMB2WX(). More importantly, UTF-8 conversion can never fail for a valid Unicode string, so there is no need for any fall backs.
This commit is contained in:
parent
0d7f51098d
commit
90eae99cd6
2 changed files with 3 additions and 4 deletions
|
|
@ -3295,7 +3295,7 @@ wxWCharBuffer wxSafeConvertMB2WX(const char *s)
|
|||
|
||||
wxWCharBuffer wbuf(wxConvLibc.cMB2WX(s));
|
||||
if ( !wbuf )
|
||||
wbuf = wxMBConvUTF8().cMB2WX(s);
|
||||
wbuf = wxConvUTF8.cMB2WX(s);
|
||||
if ( !wbuf )
|
||||
wbuf = wxConvISO8859_1.cMB2WX(s);
|
||||
|
||||
|
|
@ -3309,7 +3309,7 @@ wxCharBuffer wxSafeConvertWX2MB(const wchar_t *ws)
|
|||
|
||||
wxCharBuffer buf(wxConvLibc.cWX2MB(ws));
|
||||
if ( !buf )
|
||||
buf = wxMBConvUTF8(wxMBConvUTF8::MAP_INVALID_UTF8_TO_OCTAL).cWX2MB(ws);
|
||||
buf = wxConvUTF8.cWX2MB(ws);
|
||||
|
||||
return buf;
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue