X-Git-Url: https://git.saurik.com/wxWidgets.git/blobdiff_plain/efd1393bccefbb6cf12f82d5e10a4fb6080e6702..88594d02eb59a55ac85d3210a49d02918124617b:/src/common/intl.cpp?ds=sidebyside diff --git a/src/common/intl.cpp b/src/common/intl.cpp index 9875b2f168..f41c6ba9c5 100644 --- a/src/common/intl.cpp +++ b/src/common/intl.cpp @@ -1240,7 +1240,7 @@ wxString wxLocale::GetSystemEncodingName() { wxString encname; -#ifdef __WIN32__ +#if defined(__WIN32__) && !defined(__WXMICROWIN__) // FIXME: what is the error return value for GetACP()? UINT codepage = ::GetACP(); encname.Printf(_T("windows-%u"), codepage); @@ -1292,14 +1292,34 @@ wxString wxLocale::GetSystemEncodingName() /* static */ wxFontEncoding wxLocale::GetSystemEncoding() { -#ifdef __WIN32__ +#if defined(__WIN32__) && !defined(__WXMICROWIN__) 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() )