X-Git-Url: https://git.saurik.com/wxWidgets.git/blobdiff_plain/1fc10687bf85c1d2ccce2c43c8300a4b0a0edbce..c33edc08d6a5f6937624347f25934937164c13a1:/include/wx/stringops.h diff --git a/include/wx/stringops.h b/include/wx/stringops.h index b8ba8abd74..2e36900adc 100644 --- a/include/wx/stringops.h +++ b/include/wx/stringops.h @@ -70,7 +70,7 @@ struct WXDLLIMPEXP_BASE wxStringOperationsUtf8 #endif // table of offsets to skip forward when iterating over UTF-8 sequence - static unsigned char ms_utf8IterTable[256]; + static const unsigned char ms_utf8IterTable[256]; template @@ -156,7 +156,15 @@ struct WXDLLIMPEXP_BASE wxStringOperationsUtf8 } // decodes single UTF-8 character from UTF-8 string - static wxUniChar DecodeChar(wxStringImpl::const_iterator i); + static wxUniChar DecodeChar(wxStringImpl::const_iterator i) + { + if ( (unsigned char)*i < 0x80 ) + return (int)*i; + return DecodeNonAsciiChar(i); + } + +private: + static wxUniChar DecodeNonAsciiChar(wxStringImpl::const_iterator i); }; #endif // wxUSE_UNICODE_UTF8