1 From 864f03034d9af34386cd854d105c9bddbc06ab3a Mon Sep 17 00:00:00 2001
2 Message-Id: <864f03034d9af34386cd854d105c9bddbc06ab3a.1511519809.git.jan.steffens@gmail.com>
3 From: "Jan Alexander Steffens (heftig)" <jan.steffens@gmail.com>
4 Date: Fri, 24 Nov 2017 11:36:33 +0100
5 Subject: [PATCH] Avoid non-UTF-8 code
8 gmime/gmime-filter-charset.c | 4 ++--
9 gmime/gmime-iconv-utils.c | 4 ++--
10 tests/test-iconv.c | 48 ++++++++++++++++++++++----------------------
11 3 files changed, 28 insertions(+), 28 deletions(-)
13 diff --git a/gmime/gmime-filter-charset.c b/gmime/gmime-filter-charset.c
14 index 052268e15c519af0..023823cf8a1251e9 100644
15 --- a/gmime/gmime-filter-charset.c
16 +++ b/gmime/gmime-filter-charset.c
17 @@ -243,8 +243,8 @@ filter_complete (GMimeFilter *filter, char *in, size_t len, size_t prespace,
19 } else if (errno == EINVAL) {
21 - * EINVAL An incomplete multibyte sequence has been encoun
22 - * tered in the input.
23 + * EINVAL An incomplete multibyte sequence has been
24 + * encountered in the input.
26 * We assume that this can only happen if we've run out of
27 * bytes for a multibyte sequence, if not we're in trouble.
28 diff --git a/gmime/gmime-iconv-utils.c b/gmime/gmime-iconv-utils.c
29 index 94ddf36e2554493e..a6a874e8218c08f6 100644
30 --- a/gmime/gmime-iconv-utils.c
31 +++ b/gmime/gmime-iconv-utils.c
32 @@ -132,8 +132,8 @@ g_mime_iconv_strndup (iconv_t cd, const char *str, size_t n)
33 converted = iconv (cd, (char **) &inbuf, &inleft, &outbuf, &outleft);
34 if (converted != (size_t) -1 || errno == EINVAL) {
36 - * EINVAL An incomplete multibyte sequence has been encoun
37 - * tered in the input.
38 + * EINVAL An incomplete multibyte sequence has been
39 + * encountered in the input.
41 * We'll just have to ignore it...
43 diff --git a/tests/test-iconv.c b/tests/test-iconv.c
44 index c1eaab821963f703..8f04f918c8a73925 100644
45 --- a/tests/test-iconv.c
46 +++ b/tests/test-iconv.c
47 @@ -111,36 +111,36 @@ struct {
50 { "Ətraflı", "utf-8" }, /* az */
51 - { "Äîáàâè Óñëóãà", "windows-cp1251" }, /* bg */
52 - { "Cònjuge", "iso-8859-1" }, /* ca */
53 - { "Avanceret søgning", "iso-8859-1" }, /* da */
54 - { "Löschen", "iso-8859-1" }, /* de */
55 + { "\xc4\xee\xe1\xe0\xe2\xe8 \xd3\xf1\xeb\xf3\xe3\xe0", "windows-cp1251" }, /* bg */
56 + { "C\xf2njuge", "iso-8859-1" }, /* ca */
57 + { "Avanceret s\xf8gning", "iso-8859-1" }, /* da */
58 + { "L\xf6schen", "iso-8859-1" }, /* de */
59 { "some text", "iso-8859-1" }, /* en */
60 - { "päivää", "iso-8859-15" }, /* fi */
61 - { "Modifié", "iso-8859-1" }, /* fr */
62 - { "Tidéal", "iso-8859-1" }, /* ga */
63 - { "Fábrica", "iso-8859-1" }, /* gl */
64 - { "Szem\e-Bélyhívó\e-A ", "iso-8859-2" }, /* hu */
65 - { "Non c'é corrispondenza", "iso-8859-1" }, /* it */
66 - { "\e$(B>e5i8!:w\e(B", "euc-jp" }, /* ja */
67 - { "\e$(C0m1^\e(B \e$(C0K;v\e(B", "euc-kr" }, /* ko */
68 - { "Iðsami paieðka", "iso-8859-13" }, /* lt */
69 - { "Paplaðinâtâ Meklçðana", "iso-8859-13" }, /* lv */
70 - { "Kopiëren", "iso-8859-15" }, /* nl */
71 - { "Øydelagd Søk", "iso-8859-1" }, /* nn */
72 - { "Avansert søk", "iso-8859-1" }, /* no */
73 - { "\e-B¬ród³a\e-A ksi\e-B±¿ki\e-A adresowej", "iso-8859-2" }, /* pl */
74 - { "C\e-Bãutare\e-A avansat\e-Bã\e-A ", "iso-8859-2" }, /* ro */
75 - { "\e-LÀÐáèØàÕÝÝëÙ\e-A \e-LßÞØáÚ\e-A ", "koi8-r" }, /* ru */
76 + { "p\xe4iv\xe4\xe4", "iso-8859-15" }, /* fi */
77 + { "Modifi\xe9", "iso-8859-1" }, /* fr */
78 + { "Tid\xe9al", "iso-8859-1" }, /* ga */
79 + { "F\xe1brica", "iso-8859-1" }, /* gl */
80 + { "Szem\x1b-B\xe9lyh\xedv\xf3\x1b-A ", "iso-8859-2" }, /* hu */
81 + { "Non c'\xe9 corrispondenza", "iso-8859-1" }, /* it */
82 + { "\x1b$(B>e5i8!:w\x1b(B", "euc-jp" }, /* ja */
83 + { "\x1b$(C0m1^\x1b(B \x1b$(C0K;v\x1b(B", "euc-kr" }, /* ko */
84 + { "I\xf0sami paie\xf0ka", "iso-8859-13" }, /* lt */
85 + { "Papla\xf0in\xe2t\xe2 Mekl\xe7\xf0ana", "iso-8859-13" }, /* lv */
86 + { "Kopi\xebren", "iso-8859-15" }, /* nl */
87 + { "\xd8ydelagd S\xf8k", "iso-8859-1" }, /* nn */
88 + { "Avansert s\xf8k", "iso-8859-1" }, /* no */
89 + { "\x1b-B\xacr\xf3d\xb3a\x1b-A ksi\x1b-B\xb1\xbfki\x1b-A adresowej", "iso-8859-2" }, /* pl */
90 + { "C\x1b-B\xe3utare\x1b-A avansat\x1b-B\xe3\x1b-A ", "iso-8859-2" }, /* ro */
91 + { "\x1b-L\xc0\xd0\xe1\xe8\xd8\xe0\xd5\xdd\xdd\xeb\xd9\x1b-A \x1b-L\xdf\xde\xd8\xe1\xda\x1b-A ", "koi8-r" }, /* ru */
92 { "Pokročilé hľadanie", "utf-8" }, /* sk */
93 { "Ga želite", "utf-8" }, /* sl */
94 - { "den ändå?", "iso-8859-1" }, /* sv */
95 - { "Geli\e-Mþmiþ\e-A Arama", "iso-8859-9" }, /* tr */
96 - { "õÄÏÓËÏÎÁÌÅÎÉÊ ÐÏÛÕË", "koi8-u" }, /* uk */
97 + { "den \xe4nd\xe5?", "iso-8859-1" }, /* sv */
98 + { "Geli\x1b-M\xfemi\xfe\x1b-A Arama", "iso-8859-9" }, /* tr */
99 + { "\xf5\xc4\xcf\xd3\xcb\xcf\xce\xc1\xcc\xc5\xce\xc9\xca \xd0\xcf\xdb\xd5\xcb", "koi8-u" }, /* uk */
102 /* this is expected to fail */
103 - { "é’ÉšŽå°‹æ\e(I>\e(B", "utf-8" }, /* zh_TW */
104 + { "\xe9\x92\xc9\x9a\x8e\xe5\xb0\x8b\xe6\x1b(I>\x1b(B", "utf-8" }, /* zh_TW */