X-Git-Url: https://git.saurik.com/wxWidgets.git/blobdiff_plain/4676948b6814c97b93c431a8cbcd8c0352c87ba9..0425151023593cb31da0ee0a652da173ca9abfde:/src/common/fmapbase.cpp diff --git a/src/common/fmapbase.cpp b/src/common/fmapbase.cpp index 83e91e7016..b49754d7f9 100644 --- a/src/common/fmapbase.cpp +++ b/src/common/fmapbase.cpp @@ -353,6 +353,8 @@ void wxFontMapperBase::RestorePath(const wxString& pathOld) GetConfig()->SetPath(pathOld); } +#endif + // ---------------------------------------------------------------------------- // charset/encoding correspondence // ---------------------------------------------------------------------------- @@ -360,6 +362,20 @@ void wxFontMapperBase::RestorePath(const wxString& pathOld) wxFontEncoding wxFontMapperBase::CharsetToEncoding(const wxString& charset, bool WXUNUSED(interactive)) +{ + int enc = NonInteractiveCharsetToEncoding(charset); + if ( enc == wxFONTENCODING_UNKNOWN ) + { + // we should return wxFONTENCODING_SYSTEM from here for unknown + // encodings + enc = wxFONTENCODING_SYSTEM; + } + + return (wxFontEncoding)enc; +} + +int +wxFontMapperBase::NonInteractiveCharsetToEncoding(const wxString& charset) { wxFontEncoding encoding = wxFONTENCODING_SYSTEM; @@ -380,7 +396,7 @@ wxFontMapperBase::CharsetToEncoding(const wxString& charset, if ( value == wxFONTENCODING_UNKNOWN ) { // don't try to find it, in particular don't ask the user - return wxFONTENCODING_SYSTEM; + return value; } if ( value >= 0 && value <= wxFONTENCODING_MAX ) @@ -642,7 +658,5 @@ wxString wxFontMapperBase::GetEncodingName(wxFontEncoding encoding) return str; } -#endif // wxUSE_CONFIG - #endif // wxUSE_FONTMAP