]> git.saurik.com Git - wxWidgets.git/commitdiff
added support for koi8-u
authorVadim Zeitlin <vadim@wxwidgets.org>
Sat, 10 Apr 2004 23:43:49 +0000 (23:43 +0000)
committerVadim Zeitlin <vadim@wxwidgets.org>
Sat, 10 Apr 2004 23:43:49 +0000 (23:43 +0000)
git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@26695 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775

docs/changes.txt
include/wx/fontenc.h
samples/font/font.cpp
src/common/encconv.cpp
src/common/fmapbase.cpp
src/common/fontmap.cpp
src/common/unictabl.inc
src/unix/fontutil.cpp

index 51b8a4d090590aa69e325c299f737de0a817ecfb..6dd0708c9ba3577c5c2a5563b6408451052ab577 100644 (file)
@@ -91,6 +91,7 @@ All (GUI):
   resulting in much better display of scaled images
 - Added UpdateSize to wxSplitterWindow to allow layout while hidden
 - implemented Freeze/Thaw() for wxGenericTreeCtrl (Kevin Hock)
+- support for KOI8-U encoding added (Yuriy Tkachenko)
 
 wxMSW:
 
index 622c78fde3789f2f1c332330a82351cb8710ec47..0f4b1ca9bce5280c47ff125e7acbeeb1606eb7a1 100644 (file)
@@ -39,7 +39,8 @@ enum wxFontEncoding
     wxFONTENCODING_ISO8859_MAX,
 
     // Cyrillic charset soup (see http://czyborra.com/charsets/cyrillic.html)
-    wxFONTENCODING_KOI8,            // we don't support any of KOI8 variants
+    wxFONTENCODING_KOI8,            // KOI8 Russian
+    wxFONTENCODING_KOI8_U,          // KOI8 Ukrainian
     wxFONTENCODING_ALTERNATIVE,     // same as MS-DOS CP866
     wxFONTENCODING_BULGARIAN,       // used under Linux in Bulgaria
 
index 10242436c951889907f83b5554140a739dac516c..8277b873e9ecd36c780225e71f59d7652ba9f833 100644 (file)
@@ -425,6 +425,7 @@ void MyFrame::OnEnumerateFamiliesForEncoding(wxCommandEvent& WXUNUSED(event))
         wxFONTENCODING_ISO8859_7,
         wxFONTENCODING_ISO8859_15,
         wxFONTENCODING_KOI8,
+        wxFONTENCODING_KOI8_U,
         wxFONTENCODING_CP1250,
         wxFONTENCODING_CP1251,
         wxFONTENCODING_CP1252,
@@ -438,6 +439,7 @@ void MyFrame::OnEnumerateFamiliesForEncoding(wxCommandEvent& WXUNUSED(event))
         wxT("Greek (ISO-8859-7)"),
         wxT("Western European with Euro (ISO-8859-15)"),
         wxT("KOI8-R"),
+        wxT("KOI8-U"),
         wxT("Windows Central European (CP 1250)"),
         wxT("Windows Cyrillic (CP 1251)"),
         wxT("Windows Western European (CP 1252)"),
index 13850247c9a66a1ea60a82fd87a3561a75037d42..d679bd9b3f10826dc1ed2c452373d2e44a7ca6c6 100644 (file)
@@ -412,7 +412,7 @@ static wxFontEncoding
 
     // Cyrillic
     {
-        /* unix    */ {wxFONTENCODING_KOI8, wxFONTENCODING_ISO8859_5, STOP},
+        /* unix    */ {wxFONTENCODING_KOI8, wxFONTENCODING_KOI8_U, wxFONTENCODING_ISO8859_5, STOP},
         /* windows */ {wxFONTENCODING_CP1251, STOP},
         /* os2     */ {STOP},
         /* mac     */ {wxFONTENCODING_MACCYRILLIC, STOP}
index e9b303613cdf74b7cc64aa1025a05e75a4c25324..07faf9ef98ecba03afe6a2c48ab3b4da6f7afef9 100644 (file)
@@ -72,6 +72,7 @@ static wxFontEncoding gs_encodings[] =
     wxFONTENCODING_ISO8859_14,
     wxFONTENCODING_ISO8859_15,
     wxFONTENCODING_KOI8,
+    wxFONTENCODING_KOI8_U,
     wxFONTENCODING_CP932,
     wxFONTENCODING_CP936,
     wxFONTENCODING_CP949,
@@ -115,6 +116,7 @@ static const wxChar* gs_encodingDescs[] =
     wxTRANSLATE( "Celtic (ISO-8859-14)" ),
     wxTRANSLATE( "Western European with Euro (ISO-8859-15)" ),
     wxTRANSLATE( "KOI8-R" ),
+    wxTRANSLATE( "KOI8-U" ),
     wxTRANSLATE( "Windows Japanese (CP 932)" ),
     wxTRANSLATE( "Windows Chinese Simplified (CP 936)" ),
     wxTRANSLATE( "Windows Korean (CP 949)" ),
@@ -158,6 +160,7 @@ static const wxChar* gs_encodingNames[] =
     wxT( "iso-8859-14" ),
     wxT( "iso-8859-15" ),
     wxT( "koi8-r" ),
+    wxT( "koi8-u" ),
     wxT( "windows-932" ),
     wxT( "windows-936" ),
     wxT( "windows-949" ),
@@ -517,14 +520,17 @@ wxFontMapperBase::NonInteractiveCharsetToEncoding(const wxString& charset)
             encoding = wxFONTENCODING_EUC_JP;
         }
         else if ( cs == wxT("KOI8-R") ||
-                  cs == wxT("KOI8-U") ||
                   cs == wxT("KOI8-RU") )
         {
             // although koi8-ru is not strictly speaking the same as koi8-r,
             // they are similar enough to make mapping it to koi8 better than
-            // not reckognizing it at all
+            // not recognizing it at all
             encoding = wxFONTENCODING_KOI8;
         }
+        else if ( cs == wxT("KOI8-U") )
+        {
+            encoding = wxFONTENCODING_KOI8_U;
+        }
         else if ( cs.Left(3) == wxT("ISO") )
         {
             // the dash is optional (or, to be exact, it is not, but
index ccf61230d9e5cc70882da9f74947840c922f4a58..8be47e51c2085ac009b0a897f70451ac29c048ca 100644 (file)
@@ -77,6 +77,7 @@ wxBEGIN_ENUM( wxFontEncoding )
        wxENUM_MEMBER( wxFONTENCODING_ISO8859_15 )
        wxENUM_MEMBER( wxFONTENCODING_ISO8859_MAX )
        wxENUM_MEMBER( wxFONTENCODING_KOI8 )
+       wxENUM_MEMBER( wxFONTENCODING_KOI8_U )
        wxENUM_MEMBER( wxFONTENCODING_ALTERNATIVE )
        wxENUM_MEMBER( wxFONTENCODING_BULGARIAN )
        wxENUM_MEMBER( wxFONTENCODING_CP437 )
index bf3c16337019bfae610c313ec2e6203144e545db..b7e76fc04c631b7a76292c375e0994f2c7046e56 100644 (file)
@@ -586,6 +586,31 @@ static wxUint16 encoding_table__KOI8[128] = {
  };
 
 
+/* 
+ * KOI8_U to Unicode recoding table 
+ * based on file mappings/KOI8-U.TXT by Unicode Consortium
+ */
+
+static wxUint16 encoding_table__KOI8_U[128] = {
+    0x2500, 0x2502, 0x250C, 0x2510, 0x2514, 0x2518, 0x251C, 0x2524, 
+    0x252C, 0x2534, 0x253C, 0x2580, 0x2584, 0x2588, 0x258C, 0x2590, 
+    0x2591, 0x2592, 0x2593, 0x2320, 0x25A0, 0x2219, 0x221A, 0x2248, 
+    0x2264, 0x2265, 0x00A0, 0x2321, 0x00B0, 0x00B2, 0x00B7, 0x00F7, 
+    0x2550, 0x2551, 0x2552, 0x0451, 0x0454, 0x2554, 0x0456, 0x0457, 
+    0x2557, 0x2558, 0x2559, 0x255A, 0x255B, 0x0491, 0x255D, 0x255E, 
+    0x255F, 0x2560, 0x2561, 0x0401, 0x0403, 0x2563, 0x0406, 0x0407, 
+    0x2566, 0x2567, 0x2568, 0x2569, 0x256A, 0x0490, 0x256C, 0x00A9, 
+    0x044E, 0x0430, 0x0431, 0x0446, 0x0434, 0x0435, 0x0444, 0x0433, 
+    0x0445, 0x0438, 0x0439, 0x043A, 0x043B, 0x043C, 0x043D, 0x043E, 
+    0x043F, 0x044F, 0x0440, 0x0441, 0x0442, 0x0443, 0x0436, 0x0432, 
+    0x044C, 0x044B, 0x0437, 0x0448, 0x044D, 0x0449, 0x0447, 0x044A, 
+    0x042E, 0x0410, 0x0411, 0x0426, 0x0414, 0x0415, 0x0424, 0x0413, 
+    0x0425, 0x0418, 0x0419, 0x041A, 0x041B, 0x041C, 0x041D, 0x041E, 
+    0x041F, 0x042F, 0x0420, 0x0421, 0x0422, 0x0423, 0x0416, 0x0412, 
+    0x042C, 0x042B, 0x0417, 0x0428, 0x042D, 0x0429, 0x0427, 0x042A
+ };
+
+
 
 
 
@@ -842,5 +867,6 @@ static struct {
     { wxFONTENCODING_CP1256, encoding_table__CP1256},
     { wxFONTENCODING_CP1257, encoding_table__CP1257},
     { wxFONTENCODING_KOI8, encoding_table__KOI8},
+    { wxFONTENCODING_KOI8_U, encoding_table__KOI8_U},
     {wxFONTENCODING_MAX /*anything*/, NULL}
  };
index e422117996645d276c7e23429997834dd584b893..df38f593be079f777a61d04ea8686a24b76f9ad9 100644 (file)
@@ -715,6 +715,7 @@ bool wxGetNativeFontEncoding(wxFontEncoding encoding,
             break;
 
         case wxFONTENCODING_KOI8:
+        case wxFONTENCODING_KOI8_U:
             info->xregistry = wxT("koi8");
 
             // we don't make distinction between koi8-r, koi8-u and koi8-ru (so far)