From: Vadim Zeitlin Date: Tue, 20 Nov 2001 18:49:51 +0000 (+0000) Subject: more DBCS-related changes (patch 481898) X-Git-Url: https://git.saurik.com/wxWidgets.git/commitdiff_plain/c7821f944fa976adfa7a2285c0aea7c4a4a4bdcb more DBCS-related changes (patch 481898) git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@12528 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775 --- diff --git a/src/common/fontmap.cpp b/src/common/fontmap.cpp index 60fd3d2cbc..ca2eaa905c 100644 --- a/src/common/fontmap.cpp +++ b/src/common/fontmap.cpp @@ -293,8 +293,8 @@ wxConfigBase *wxFontMapper::GetConfig() m_configIsDummy = FALSE; // FIXME: ideally, we should add keys from dummy config to the real one now, // but it is a low-priority task because typical wxWin application - // either doesn't use wxConfig at all or creates wxConfig object in - // wxApp::OnInit(), before any real interaction with the user takes + // either doesn't use wxConfig at all or creates wxConfig object in + // wxApp::OnInit(), before any real interaction with the user takes // place... } @@ -564,6 +564,25 @@ wxFontEncoding wxFontMapper::CharsetToEncoding(const wxString& charset, encoding = (wxFontEncoding)value; } } + + switch ( value ) + { + case 932: + encoding = wxFONTENCODING_CP932; + break; + + case 936: + encoding = wxFONTENCODING_CP936; + break; + + case 949: + encoding = wxFONTENCODING_CP949; + break; + + case 950: + encoding = wxFONTENCODING_CP950; + break; + } } } } diff --git a/src/common/intl.cpp b/src/common/intl.cpp index 9875b2f168..0aefb4530a 100644 --- a/src/common/intl.cpp +++ b/src/common/intl.cpp @@ -1295,11 +1295,31 @@ wxFontEncoding wxLocale::GetSystemEncoding() #ifdef __WIN32__ UINT codepage = ::GetACP(); - // wxWindows only knows about CP1250-1257 + // wxWindows only knows about CP1250-1257, 932, 936, 949, 950 if ( codepage >= 1250 && codepage <= 1257 ) { return (wxFontEncoding)(wxFONTENCODING_CP1250 + codepage - 1250); } + + if ( codepage == 932 ) + { + return wxFONTENCODING_CP932; + } + + if ( codepage == 936 ) + { + return wxFONTENCODING_CP936; + } + + if ( codepage == 949 ) + { + return wxFONTENCODING_CP949; + } + + if ( codepage == 950 ) + { + return wxFONTENCODING_CP950; + } #elif defined(__UNIX_LIKE__) && wxUSE_FONTMAP wxString encname = GetSystemEncodingName(); if ( !encname.empty() )