From: Dimitri Schoolwerth Date: Thu, 16 Jun 2005 14:16:50 +0000 (+0000) Subject: added Thai/CP874 support for MSW X-Git-Url: https://git.saurik.com/wxWidgets.git/commitdiff_plain/3c832d589dccf8cf9cb499ab61d2e7dae058ad0e added Thai/CP874 support for MSW git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@34670 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775 --- diff --git a/src/common/fmapbase.cpp b/src/common/fmapbase.cpp index e473054fe8..2358475b48 100644 --- a/src/common/fmapbase.cpp +++ b/src/common/fmapbase.cpp @@ -73,6 +73,7 @@ static wxFontEncoding gs_encodings[] = wxFONTENCODING_ISO8859_15, wxFONTENCODING_KOI8, wxFONTENCODING_KOI8_U, + wxFONTENCODING_CP874, wxFONTENCODING_CP932, wxFONTENCODING_CP936, wxFONTENCODING_CP949, @@ -117,6 +118,7 @@ static const wxChar* gs_encodingDescs[] = wxTRANSLATE( "Western European with Euro (ISO-8859-15)" ), wxTRANSLATE( "KOI8-R" ), wxTRANSLATE( "KOI8-U" ), + wxTRANSLATE( "Windows Thai (CP 874)" ), wxTRANSLATE( "Windows Japanese (CP 932)" ), wxTRANSLATE( "Windows Chinese Simplified (CP 936)" ), wxTRANSLATE( "Windows Korean (CP 949)" ), @@ -161,6 +163,7 @@ static const wxChar* gs_encodingNames[] = wxT( "iso-8859-15" ), wxT( "koi8-r" ), wxT( "koi8-u" ), + wxT( "windows-874" ), wxT( "windows-932" ), wxT( "windows-936" ), wxT( "windows-949" ), @@ -626,6 +629,10 @@ wxFontMapperBase::NonInteractiveCharsetToEncoding(const wxString& charset) switch ( value ) { + case 874: + encoding = wxFONTENCODING_CP874; + break; + case 932: encoding = wxFONTENCODING_CP932; break; diff --git a/src/common/intl.cpp b/src/common/intl.cpp index 7d449cea28..8aeb57fbe9 100644 --- a/src/common/intl.cpp +++ b/src/common/intl.cpp @@ -2277,12 +2277,17 @@ wxFontEncoding wxLocale::GetSystemEncoding() #if defined(__WIN32__) && !defined(__WXMICROWIN__) UINT codepage = ::GetACP(); - // wxWidgets only knows about CP1250-1257, 932, 936, 949, 950 + // wxWidgets only knows about CP1250-1257, 874, 932, 936, 949, 950 if ( codepage >= 1250 && codepage <= 1257 ) { return (wxFontEncoding)(wxFONTENCODING_CP1250 + codepage - 1250); } + if ( codepage == 874 ) + { + return wxFONTENCODING_CP874; + } + if ( codepage == 932 ) { return wxFONTENCODING_CP932; diff --git a/src/msw/fontutil.cpp b/src/msw/fontutil.cpp index 266971d30a..a885dcb794 100644 --- a/src/msw/fontutil.cpp +++ b/src/msw/fontutil.cpp @@ -236,7 +236,7 @@ wxFontEncoding wxGetFontEncFromCharSet(int cs) break; case THAI_CHARSET: - fontEncoding = wxFONTENCODING_CP437; + fontEncoding = wxFONTENCODING_CP874; break; case SHIFTJIS_CHARSET: