From 23c883b71a6b0d067619afc41992d5d0476f7110 Mon Sep 17 00:00:00 2001 From: Vadim Zeitlin Date: Sat, 19 Jul 2008 01:45:38 +0000 Subject: [PATCH] fix bug with wxCSConv("ASCII") git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/branches/WX_2_8_BRANCH@54703 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775 --- src/common/strconv.cpp | 10 ++++++++++ 1 file changed, 10 insertions(+) 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