+}
+
+void wxCSConv::SetEncoding(wxFontEncoding encoding)
+{
+    switch ( encoding )
+    {
+        case wxFONTENCODING_MAX:
+        case wxFONTENCODING_SYSTEM:
+            if ( m_name )
+            {
+                // It's ok to not have encoding value if we have a name for it.
+                m_encoding = wxFONTENCODING_SYSTEM;
+            }
+            else // No name neither.
+            {
+                // Fall back to the system default encoding in this case (not
+                // sure how much sense does this make but this is how the old
+                // code used to behave).
+#if wxUSE_INTL
+                m_encoding = wxLocale::GetSystemEncoding();
+                if ( m_encoding == wxFONTENCODING_SYSTEM )
+#endif // wxUSE_INTL
+                    m_encoding = wxFONTENCODING_ISO8859_1;
+            }
+            break;
+
+        case wxFONTENCODING_DEFAULT:
+            // wxFONTENCODING_DEFAULT is same as US-ASCII in this context
+            m_encoding = wxFONTENCODING_ISO8859_1;
+            break;
+
+        default:
+            // Just use the provided encoding.
+            m_encoding = encoding;
+    }