diff --git a/src/common/strconv.cpp b/src/common/strconv.cpp index 391b1e1e87..419e1bc3de 100644 --- a/src/common/strconv.cpp +++ b/src/common/strconv.cpp @@ -3205,6 +3205,16 @@ wxCSConv::wxCSConv(const wxChar *charset) #if wxUSE_FONTMAP m_encoding = wxFontMapperBase::GetEncodingFromName(charset); + if ( m_encoding == wxFONTENCODING_MAX ) + { + // set to unknown/invalid value + m_encoding = wxFONTENCODING_SYSTEM; + } + else if ( m_encoding == wxFONTENCODING_DEFAULT ) + { + // wxFONTENCODING_DEFAULT is same as US-ASCII in this context + m_encoding = wxFONTENCODING_ISO8859_1; + } #else m_encoding = wxFONTENCODING_SYSTEM; #endif