]> git.saurik.com Git - wxWidgets.git/commitdiff
recognize 646 charset as US-ASCII (this is how it is used by Solaris)
authorVadim Zeitlin <vadim@wxwidgets.org>
Wed, 23 Jan 2002 12:02:40 +0000 (12:02 +0000)
committerVadim Zeitlin <vadim@wxwidgets.org>
Wed, 23 Jan 2002 12:02:40 +0000 (12:02 +0000)
git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@13762 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775

src/common/fontmap.cpp

index f40ea75e954a4d131fd43f072e43d0e8f2072304..170d32aedd8d38b8d26358437e0be0976052d5ae 100644 (file)
@@ -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;
         }