From kde-pim Sun Jan 25 16:44:55 2009 From: Olivier Trichet Date: Sun, 25 Jan 2009 16:44:55 +0000 To: kde-pim Subject: [Kde-pim] charsets from KCharset are not valid for mime encoding Message-Id: <200901251744.55670.nive () nivalis ! org> X-MARC-Message: https://marc.info/?l=kde-pim&m=123290358203355 MIME-Version: 1 Content-Type: multipart/mixed; boundary="--Boundary-00=_HcJfJbdZGax+5Sx" --Boundary-00=_HcJfJbdZGax+5Sx Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit 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 --Boundary-00=_HcJfJbdZGax+5Sx Content-Type: text/x-patch; charset="us-ascii"; name="iso-encoding_hyphen.diff" Content-Transfer-Encoding: quoted-printable Content-Disposition: inline; filename="iso-encoding_hyphen.diff" Index: kdelibs/kdecore/localization/kcharsets.cpp =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D =2D-- kdelibs/kdecore/localization/kcharsets.cpp (r=C3=A9vision 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: =2DISO 8859-1 +ISO-8859-1 i18n:Western European =2DISO 8859-15 +ISO-8859-15 i18n:Western European =2DISO 8859-14 +ISO-8859-14 i18n:Western European cp 1252 i18n:Western European IBM850 i18n:Western European =2DISO 8859-2 +ISO-8859-2 i18n:Central European =2DISO 8859-3 +ISO-8859-3 i18n:Central European =2DISO 8859-4 +ISO-8859-4 i18n:Baltic =2DISO 8859-13 +ISO-8859-13 i18n:Baltic =2DISO 8859-16 +ISO-8859-16 i18n:South-Eastern Europe cp 1250 i18n:Central European @@ -69,7 +69,7 @@ i18n:Baltic KOI8-R i18n:Cyrillic =2DISO 8859-5 +ISO-8859-5 i18n:Cyrillic cp 1251 i18n:Cyrillic @@ -95,35 +95,35 @@ i18n:Japanese EUC-JP i18n:Japanese =2DISO 8859-7 +ISO-8859-7 i18n:Greek cp 1253 i18n:Greek =2DISO 8859-6 +ISO-8859-6 i18n:Arabic cp 1256 i18n:Arabic =2DISO 8859-8 +ISO-8859-8 i18n:Hebrew =2DISO 8859-8-I +ISO-8859-8-I i18n:Hebrew cp 1255 i18n:Hebrew =2DISO 8859-9 +ISO-8859-9 i18n:Turkish =2DTIS620 +TIS-620 i18n:Thai =2DISO 8859-11 +ISO-8859-11 i18n:Thai UTF-8 i18n:Unicode UTF-16 i18n:Unicode =2Dutf7 +utf-7 i18n:Unicode ucs2 i18n:Unicode =2DISO 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[] =3D =2D "ISO 8859-1\0" + "ISO-8859-1\0" I18N_NOOP2("@item Text character set", "Western European")"\0" =2D "ISO 8859-15\0" =2D "ISO 8859-14\0" + "ISO-8859-15\0" + "ISO-8859-14\0" "cp 1252\0" "IBM850\0" =2D "ISO 8859-2\0" + "ISO-8859-2\0" I18N_NOOP2("@item Text character set", "Central European")"\0" =2D "ISO 8859-3\0" =2D "ISO 8859-4\0" + "ISO-8859-3\0" + "ISO-8859-4\0" I18N_NOOP2("@item Text character set", "Baltic")"\0" =2D "ISO 8859-13\0" =2D "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" =2D "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" =2D "ISO 8859-7\0" + "ISO-8859-7\0" I18N_NOOP2("@item Text character set", "Greek")"\0" "cp 1253\0" =2D "ISO 8859-6\0" + "ISO-8859-6\0" I18N_NOOP2("@item Text character set", "Arabic")"\0" "cp 1256\0" =2D "ISO 8859-8\0" + "ISO-8859-8\0" I18N_NOOP2("@item Text character set", "Hebrew")"\0" =2D "ISO 8859-8-I\0" + "ISO-8859-8-I\0" "cp 1255\0" =2D "ISO 8859-9\0" =2D "TIS620\0" + "ISO-8859-9\0" + "TIS-620\0" I18N_NOOP2("@item Text character set", "Thai")"\0" =2D "ISO 8859-11\0" + "ISO-8859-11\0" "UTF-8\0" I18N_NOOP2("@item Text character set", "Unicode")"\0" "UTF-16\0" =2D "utf7\0" + "utf-7\0" "ucs2\0" =2D "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"; =20 + static const int language_for_encoding_indices[] =3D { 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, =2D 433, 426, 446, 426, 454, 185, 465, 472, =2D 477, 472, 489, 495, 503, 495, 510, 495, =2D 515, 495, 520, 495, 536, 545, 560, 573, =2D 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 }; =20 /* @@ -240,11 +241,11 @@ koi unified koi8-r us-ascii =2Diso 8859-1 +iso-8859-1 usascii =2Diso 8859-1 +iso-8859-1 ascii =2Diso 8859-1 +iso-8859-1 unicode-1-1-utf-7 utf-7 ucs2 @@ -300,7 +301,7 @@ cp-10000 apple roman thai-tis620 =2Diso 8859-11 +iso-8859-11 windows-874 ibm874 windows874 @@ -336,7 +337,7 @@ "koi8-r\0" "koi unified\0" "us-ascii\0" =2D "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" =2D "iso 8859-11\0" + "iso-8859-11\0" "windows-874\0" "ibm874\0" "windows874\0" --Boundary-00=_HcJfJbdZGax+5Sx Content-Type: text/plain; charset="us-ascii" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit Content-Disposition: inline _______________________________________________ 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/ --Boundary-00=_HcJfJbdZGax+5Sx--