]> git.saurik.com Git - wxWidgets.git/blobdiff - include/wx/stringops.h
moving common code
[wxWidgets.git] / include / wx / stringops.h
index b8ba8abd749c21430986cedad4f7dc272877528e..2e36900adc7ecb90908c2c1ce709857ff1a7fcea 100644 (file)
@@ -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<typename Iterator>
@@ -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