[prev in list] [next in list] [prev in thread] [next in thread] 

List:       kde-pim
Subject:    [Kde-pim] charsets from KCharset are not valid for mime encoding
From:       Olivier Trichet <nive () nivalis ! org>
Date:       2009-01-25 16:44:55
Message-ID: 200901251744.55670.nive () nivalis ! org
[Download RAW message or body]

Hello,

In the list of encoding names that KCharset returns, the "ISO-xxx-x" encodings 
are given as "ISO xxxx-x" (note the space).
This leads to issues in both kmail and knode[2] where messages were sent with 
improper charset because the legal charsets[3] for mime part are in the form 
"ISO-xxx-x".
The current fix is a workaround that replace "ISO " with "ISO-"...


The attached patch changes encoding names declared in KCharset to the "ISO-
xxxx-x" form (and to more "official" name for a few others)

Any comments ?

Olivier


[1] https://bugs.kde.org/show_bug.cgi?id=171947
[2] http://bugs.kde.org/show_bug.cgi?id=169411
[3] http://www.iana.org/assignments/character-sets


["iso-encoding_hyphen.diff" (text/x-patch)]

Index: kdelibs/kdecore/localization/kcharsets.cpp
===================================================================
--- kdelibs/kdecore/localization/kcharsets.cpp	(révision 916415)
+++ kdelibs/kdecore/localization/kcharsets.cpp	(copie de travail)
@@ -41,25 +41,25 @@
  * ### FIXME KDE4: the name of the encodings should mostly be uppercase
  * The names of this list are user-visible
  * Generate with generate_string_table.pl, input data:
-ISO 8859-1
+ISO-8859-1
 i18n:Western European
-ISO 8859-15
+ISO-8859-15
 i18n:Western European
-ISO 8859-14
+ISO-8859-14
 i18n:Western European
 cp 1252
 i18n:Western European
 IBM850
 i18n:Western European
-ISO 8859-2
+ISO-8859-2
 i18n:Central European
-ISO 8859-3
+ISO-8859-3
 i18n:Central European
-ISO 8859-4
+ISO-8859-4
 i18n:Baltic
-ISO 8859-13
+ISO-8859-13
 i18n:Baltic
-ISO 8859-16
+ISO-8859-16
 i18n:South-Eastern Europe
 cp 1250
 i18n:Central European
@@ -69,7 +69,7 @@
 i18n:Baltic
 KOI8-R
 i18n:Cyrillic
-ISO 8859-5
+ISO-8859-5
 i18n:Cyrillic
 cp 1251
 i18n:Cyrillic
@@ -95,35 +95,35 @@
 i18n:Japanese
 EUC-JP
 i18n:Japanese
-ISO 8859-7
+ISO-8859-7
 i18n:Greek
 cp 1253
 i18n:Greek
-ISO 8859-6
+ISO-8859-6
 i18n:Arabic
 cp 1256
 i18n:Arabic
-ISO 8859-8
+ISO-8859-8
 i18n:Hebrew
-ISO 8859-8-I
+ISO-8859-8-I
 i18n:Hebrew
 cp 1255
 i18n:Hebrew
-ISO 8859-9
+ISO-8859-9
 i18n:Turkish
-TIS620
+TIS-620
 i18n:Thai
-ISO 8859-11
+ISO-8859-11
 i18n:Thai
 UTF-8
 i18n:Unicode
 UTF-16
 i18n:Unicode
-utf7
+utf-7
 i18n:Unicode
 ucs2
 i18n:Unicode
-ISO 10646-UCS-2
+ISO-10646-UCS-2
 i18n:Unicode
 winsami2
 i18n:Northern Saami
@@ -151,19 +151,19 @@
  * - TSCII: TODO
  */
 static const char language_for_encoding_string[] =
-    "ISO 8859-1\0"
+    "ISO-8859-1\0"
     I18N_NOOP2("@item Text character set", "Western European")"\0"
-    "ISO 8859-15\0"
-    "ISO 8859-14\0"
+    "ISO-8859-15\0"
+    "ISO-8859-14\0"
     "cp 1252\0"
     "IBM850\0"
-    "ISO 8859-2\0"
+    "ISO-8859-2\0"
     I18N_NOOP2("@item Text character set", "Central European")"\0"
-    "ISO 8859-3\0"
-    "ISO 8859-4\0"
+    "ISO-8859-3\0"
+    "ISO-8859-4\0"
     I18N_NOOP2("@item Text character set", "Baltic")"\0"
-    "ISO 8859-13\0"
-    "ISO 8859-16\0"
+    "ISO-8859-13\0"
+    "ISO-8859-16\0"
     I18N_NOOP2("@item Text character set", "South-Eastern Europe")"\0"
     "cp 1250\0"
     "cp 1254\0"
@@ -171,7 +171,7 @@
     "cp 1257\0"
     "KOI8-R\0"
     I18N_NOOP2("@item Text character set", "Cyrillic")"\0"
-    "ISO 8859-5\0"
+    "ISO-8859-5\0"
     "cp 1251\0"
     "KOI8-U\0"
     "IBM866\0"
@@ -188,26 +188,26 @@
     I18N_NOOP2("@item Text character set", "Japanese")"\0"
     "jis7\0"
     "EUC-JP\0"
-    "ISO 8859-7\0"
+    "ISO-8859-7\0"
     I18N_NOOP2("@item Text character set", "Greek")"\0"
     "cp 1253\0"
-    "ISO 8859-6\0"
+    "ISO-8859-6\0"
     I18N_NOOP2("@item Text character set", "Arabic")"\0"
     "cp 1256\0"
-    "ISO 8859-8\0"
+    "ISO-8859-8\0"
     I18N_NOOP2("@item Text character set", "Hebrew")"\0"
-    "ISO 8859-8-I\0"
+    "ISO-8859-8-I\0"
     "cp 1255\0"
-    "ISO 8859-9\0"
-    "TIS620\0"
+    "ISO-8859-9\0"
+    "TIS-620\0"
     I18N_NOOP2("@item Text character set", "Thai")"\0"
-    "ISO 8859-11\0"
+    "ISO-8859-11\0"
     "UTF-8\0"
     I18N_NOOP2("@item Text character set", "Unicode")"\0"
     "UTF-16\0"
-    "utf7\0"
+    "utf-7\0"
     "ucs2\0"
-    "ISO 10646-UCS-2\0"
+    "ISO-10646-UCS-2\0"
     "winsami2\0"
     I18N_NOOP2("@item Text character set", "Northern Saami")"\0"
     "windows-1258\0"
@@ -216,6 +216,7 @@
     "TSCII\0"
     "\0";
 
+
 static const int language_for_encoding_indices[] = {
        0,   11,   28,   11,   40,   11,   52,   11,
       60,   11,   67,   78,   95,   78,  106,  117,
@@ -225,10 +226,10 @@
      286,  294,  313,  294,  317,  294,  324,  331,
      338,  343,  352,  343,  357,  343,  364,  375,
      381,  375,  389,  400,  407,  400,  415,  426,
-     433,  426,  446,  426,  454,  185,  465,  472,
-     477,  472,  489,  495,  503,  495,  510,  495,
-     515,  495,  520,  495,  536,  545,  560,  573,
-     579,  573,  586,  573,   -1
+     433,  426,  446,  426,  454,  185,  465,  473,
+     478,  473,  490,  496,  504,  496,  511,  496,
+     517,  496,  522,  496,  538,  547,  562,  575,
+     581,  575,  588,  575,   -1
 };
 
 /*
@@ -240,11 +241,11 @@
 koi unified
 koi8-r
 us-ascii
-iso 8859-1
+iso-8859-1
 usascii
-iso 8859-1
+iso-8859-1
 ascii
-iso 8859-1
+iso-8859-1
 unicode-1-1-utf-7
 utf-7
 ucs2
@@ -300,7 +301,7 @@
 cp-10000
 apple roman
 thai-tis620
-iso 8859-11
+iso-8859-11
 windows-874
 ibm874
 windows874
@@ -336,7 +337,7 @@
     "koi8-r\0"
     "koi unified\0"
     "us-ascii\0"
-    "iso 8859-1\0"
+    "iso-8859-1\0"
     "usascii\0"
     "ascii\0"
     "unicode-1-1-utf-7\0"
@@ -378,7 +379,7 @@
     "cp-10000\0"
     "apple roman\0"
     "thai-tis620\0"
-    "iso 8859-11\0"
+    "iso-8859-11\0"
     "windows-874\0"
     "ibm874\0"
     "windows874\0"


_______________________________________________
KDE PIM mailing list kde-pim@kde.org
https://mail.kde.org/mailman/listinfo/kde-pim
KDE PIM home page at http://pim.kde.org/

[prev in list] [next in list] [prev in thread] [next in thread] 

Configure | About | News | Add a list | Sponsored by KoreLogic