X-Git-Url: https://git.saurik.com/wxWidgets.git/blobdiff_plain/3e7fb236ead2891252d4fb6646697e7cfe0f7ba5..d9f7f49ea3aca3e0e0beafe648a61e6606e37663:/src/common/fontmap.cpp diff --git a/src/common/fontmap.cpp b/src/common/fontmap.cpp index 1b981f40e0..ca2eaa905c 100644 --- a/src/common/fontmap.cpp +++ b/src/common/fontmap.cpp @@ -88,6 +88,10 @@ static wxFontEncoding gs_encodings[] = wxFONTENCODING_ISO8859_14, wxFONTENCODING_ISO8859_15, wxFONTENCODING_KOI8, + wxFONTENCODING_CP932, + wxFONTENCODING_CP936, + wxFONTENCODING_CP949, + wxFONTENCODING_CP950, wxFONTENCODING_CP1250, wxFONTENCODING_CP1251, wxFONTENCODING_CP1252, @@ -120,6 +124,10 @@ static const wxChar* gs_encodingDescs[] = wxTRANSLATE( "Celtic (ISO-8859-14)" ), wxTRANSLATE( "Western European with Euro (ISO-8859-15)" ), wxTRANSLATE( "KOI8-R" ), + wxTRANSLATE( "Windows Japanese (CP 932)" ), + wxTRANSLATE( "Windows Chinese Simplified (CP 936)" ), + wxTRANSLATE( "Windows Korean (CP 949)" ), + wxTRANSLATE( "Windows Chinese Traditional (CP 950)" ), wxTRANSLATE( "Windows Central European (CP 1250)" ), wxTRANSLATE( "Windows Cyrillic (CP 1251)" ), wxTRANSLATE( "Windows Western European (CP 1252)" ), @@ -133,7 +141,7 @@ static const wxChar* gs_encodingDescs[] = wxTRANSLATE( "Unicode 8 bit (UTF-8)" ), }; -// and the internal names +// and the internal names (these are not translated on purpose!) static const wxChar* gs_encodingNames[] = { wxT( "iso-8859-1" ), @@ -152,6 +160,10 @@ static const wxChar* gs_encodingNames[] = wxT( "iso-8859-14" ), wxT( "iso-8859-15" ), wxT( "koi8-r" ), + wxT( "windows-932" ), + wxT( "windows-936" ), + wxT( "windows-949" ), + wxT( "windows-950" ), wxT( "windows-1250" ), wxT( "windows-1251" ), wxT( "windows-1252" ), @@ -161,8 +173,8 @@ static const wxChar* gs_encodingNames[] = wxT( "windows-1256" ), wxT( "windows-1257" ), wxT( "windows-437" ), - wxT( "utf7" ), - wxT( "utf8" ), + wxT( "utf-7" ), + wxT( "utf-8" ), }; // ---------------------------------------------------------------------------- @@ -281,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... } @@ -385,7 +397,7 @@ wxString wxFontMapper::GetEncodingName(wxFontEncoding encoding) { if ( gs_encodings[i] == encoding ) { - return wxGetTranslation(gs_encodingNames[i]); + return gs_encodingNames[i]; } } @@ -552,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; + } } } } @@ -712,7 +743,8 @@ bool wxFontMapper::GetAltForEncoding(wxFontEncoding encoding, // wxFatalError doesn't return } - wxString configEntry, encName = GetEncodingName(encoding); + wxString configEntry, + encName = GetEncodingName(encoding); if ( !!facename ) { configEntry = facename + _T("_");