From: Vadim Zeitlin Date: Wed, 23 Jan 2002 12:02:40 +0000 (+0000) Subject: recognize 646 charset as US-ASCII (this is how it is used by Solaris) X-Git-Url: https://git.saurik.com/wxWidgets.git/commitdiff_plain/caa6e137baa6a5a9f79c7eb3a695c1cf3addfd15 recognize 646 charset as US-ASCII (this is how it is used by Solaris) git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@13762 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775 --- diff --git a/src/common/fontmap.cpp b/src/common/fontmap.cpp index f40ea75e95..170d32aedd 100644 --- a/src/common/fontmap.cpp +++ b/src/common/fontmap.cpp @@ -479,7 +479,7 @@ wxFontEncoding wxFontMapper::CharsetToEncoding(const wxString& charset, cs.Trim(FALSE); // discard the optional quotes - if ( !!cs ) + if ( !cs.empty() ) { if ( cs[0u] == _T('"') && cs.Last() == _T('"') ) { @@ -489,7 +489,10 @@ wxFontEncoding wxFontMapper::CharsetToEncoding(const wxString& charset, cs.MakeUpper(); - if ( !cs || cs == wxT("US-ASCII") ) + // nl_langinfo() under Solaris returns 646 by default which stands for + // ISO-646, i.e. 7 bit ASCII and we should recognize it to avoid + // warnings about unrecognized encoding on each program startup + if ( cs.empty() || cs == _T("US-ASCII") || cs == _T("646") ) { encoding = wxFONTENCODING_DEFAULT; }