]> git.saurik.com Git - wxWidgets.git/blobdiff - include/wx/encconv.h
Patch #826420, and also adapted to new SWIG
[wxWidgets.git] / include / wx / encconv.h
index 2af9a9b5973a77f31826b07bbd9e61c4f1a99be0..d99eaea5e2b34ba899920d8ddb3127f943960e2e 100644 (file)
@@ -138,6 +138,17 @@ class WXDLLIMPEXP_BASE wxEncodingConverter : public wxObject
             // equivalent encodings, regardless the platform, including itself.
             static wxFontEncodingArray GetAllEquivalents(wxFontEncoding enc);
 
             // equivalent encodings, regardless the platform, including itself.
             static wxFontEncodingArray GetAllEquivalents(wxFontEncoding enc);
 
+            // Return true if [any text in] one multibyte encoding can be
+            // converted to another one losslessly.
+            //
+            // Do not call this with wxFONTENCODING_UNICODE, it doesn't make
+            // sense (always works in one sense and always depends on the text
+            // to convert in the other)
+            static bool CanConvert(wxFontEncoding encIn, wxFontEncoding encOut)
+            {
+                return GetAllEquivalents(encIn).Index(encOut) != wxNOT_FOUND;
+            }
+
     private:
 
 #if wxUSE_WCHAR_T
     private:
 
 #if wxUSE_WCHAR_T