aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorJeffrey Stedfast <fejj@ximian.com>2001-07-14 02:53:08 +0800
committerJeffrey Stedfast <fejj@src.gnome.org>2001-07-14 02:53:08 +0800
commitaabc9c14ea0e9dc152e1aee605eeaace2ba4d4f6 (patch)
tree86fc004ac681b0edd182d073fb8cce941835ece9
parent3209f94b02a3d153df60f83d9595d32348fa7ae6 (diff)
downloadgsoc2013-evolution-aabc9c14ea0e9dc152e1aee605eeaace2ba4d4f6.tar.gz
gsoc2013-evolution-aabc9c14ea0e9dc152e1aee605eeaace2ba4d4f6.tar.zst
gsoc2013-evolution-aabc9c14ea0e9dc152e1aee605eeaace2ba4d4f6.zip
Added a hack to convert charsets in the format iso8859-1 to iso-8859-1
2001-07-13 Jeffrey Stedfast <fejj@ximian.com> * camel-mime-utils.c (rfc2047_decode_word): Added a hack to convert charsets in the format iso8859-1 to iso-8859-1 because it seems to be more iconv friendly. It has been reported that on some systems, iconv doesn't know about iso8859-1 while it *does* know about iso-8859-1. See bug #4530. svn path=/trunk/; revision=11094
-rw-r--r--camel/ChangeLog24
-rw-r--r--camel/camel-mime-utils.c44
2 files changed, 43 insertions, 25 deletions
diff --git a/camel/ChangeLog b/camel/ChangeLog
index d1abaa0b19..88fab1eafc 100644
--- a/camel/ChangeLog
+++ b/camel/ChangeLog
@@ -1,14 +1,22 @@
+2001-07-13 Jeffrey Stedfast <fejj@ximian.com>
+
+ * camel-mime-utils.c (rfc2047_decode_word): Added a hack to
+ convert charsets in the format iso8859-1 to iso-8859-1 because it
+ seems to be more iconv friendly. It has been reported that on some
+ systems, iconv doesn't know about iso8859-1 while it *does* know
+ about iso-8859-1. See bug #4530.
+
2001-07-13 Peter Williams <peterw@ximian.com>
- * Makefile.am (install-exec-local): Let people install as non-root,
- but give them a bigass warning so they're not allowed to complain when
- it doesn't work right.
+ * Makefile.am (install-exec-local): Let people install as
+ non-root, but give them a bigass warning so they're not allowed to
+ complain when it doesn't work right.
- * camel-remote-store.c (sync_remote_folder): New function:
- hash table callback.
- (remote_disconnect): If cleanly disconnecting, sync our folders. Fixes
- deadlocks on exit (folders syncing after store disconnects) and also makes
- sense.
+ * camel-remote-store.c (sync_remote_folder): New function: hash
+ table callback.
+ (remote_disconnect): If cleanly disconnecting, sync our
+ folders. Fixes deadlocks on exit (folders syncing after store
+ disconnects) and also makes sense.
2001-07-13 Jeffrey Stedfast <fejj@ximian.com>
diff --git a/camel/camel-mime-utils.c b/camel/camel-mime-utils.c
index f051c0d596..357c183f02 100644
--- a/camel/camel-mime-utils.c
+++ b/camel/camel-mime-utils.c
@@ -934,8 +934,9 @@ rfc2047_decode_word(const char *in, int len)
inlen = quoted_decode(inptr+2, tmplen, decword);
break;
case 'B': {
- int state=0;
- unsigned int save=0;
+ int state = 0;
+ unsigned int save = 0;
+
inlen = base64_decode_step((char *)inptr+2, tmplen, decword, &state, &save);
/* if state != 0 then error? */
break;
@@ -945,29 +946,38 @@ rfc2047_decode_word(const char *in, int len)
return NULL;
}
d(printf("The encoded length = %d\n", inlen));
- if (inlen>0) {
+ if (inlen > 0) {
/* yuck, all this snot is to setup iconv! */
- tmplen = inptr-in-3;
- encname = alloca(tmplen+1);
- encname[tmplen]=0;
- memcpy(encname, in+2, tmplen);
-
+ tmplen = inptr - in - 3;
+ encname = alloca (tmplen + 2);
+
+ /* Hack to convert charsets like ISO8859-1 to iconv-friendly ISO-8859-1 */
+ if (!g_strncasecmp (in + 2, "iso", 3) && *(in + 5) != '-') {
+ memcpy (encname, in + 2, 3);
+ encname[3] = '-';
+ memcpy (encname + 4, in + 5, tmplen - 3);
+ tmplen++;
+ } else {
+ memcpy (encname, in + 2, tmplen);
+ }
+ encname[tmplen] = '\0';
+
inbuf = decword;
-
- outlen = inlen*6+16;
- outbase = alloca(outlen);
+
+ outlen = inlen * 6 + 16;
+ outbase = alloca (outlen);
outbuf = outbase;
-
+
/* TODO: Should this cache iconv converters? */
- ic = iconv_open("UTF-8", encname);
+ ic = iconv_open ("UTF-8", encname);
if (ic != (iconv_t)-1) {
- ret = iconv(ic, &inbuf, &inlen, &outbuf, &outlen);
+ ret = iconv (ic, &inbuf, &inlen, &outbuf, &outlen);
if (ret>=0) {
- iconv(ic, NULL, 0, &outbuf, &outlen);
+ iconv (ic, NULL, 0, &outbuf, &outlen);
*outbuf = 0;
- decoded = g_strdup(outbase);
+ decoded = g_strdup (outbase);
}
- iconv_close(ic);
+ iconv_close (ic);
} else {
w(g_warning("Cannot decode charset, header display may be corrupt: %s: %s",
encname, strerror(errno)));
c285bdc616c1a1dd62c97'>Bump PORTREVISION to reflect the (lib)iconv upgrade.knu2002-03-181-0/+1 * Iconv cleanup, stage 1b: correct {BUILD,LIB,RUN}_DEPENDS of all ports that needsobomax2002-03-181-1/+1 * Stage 1 of gettext update.ade2002-03-161-1/+1 * Update to version 1.8.8.jim2002-03-092-2/+2 * Keep up with the musical MASTER_SITES. It should be done moving aroundjim2002-01-191-1/+2 * Fix MASTER_SITES.jim2002-01-131-2/+1 * Update to version 1.8.7.jim2002-01-113-2/+3 * Update to version 1.8.6. While I'm here, add a WITH_TRANSPARENCY knobjim2001-11-284-67/+8 * Argh. Bump PORTREVISION. I forgot to apply this in the last commit.jim2001-11-251-0/+1 * Add two patches -- one fixes dccs autoresume, and the other fixes xchatjim2001-11-252-0/+63 * Update to version 1.8.5. Re-enable building with perl since xchat hasjim2001-11-032-8/+4 * Add --enable-zvt if compiled with GNOME support so things will workjim2001-10-101-2/+4 * Update to version 1.8.4. Perl support is currently disabled for systemsjim2001-10-032-2/+6 * Fix installation and packaging with GNOME.knu2001-09-061-5/+3 * - Enable NLS using the latest version of msgfmtknu2001-09-053-12/+53 * Update to version 1.8.2.jim2001-07-272-2/+2 * Update to version 1.8.1.jim2001-07-203-17/+17 * Update this to the latest and greatest "stable" version, which is 1.8.0.jim2001-06-293-31/+5 * -pthread --> ${PTHREAD_LIBS}sobomax2001-03-301-1/+1 * PLIST fixes I forgot in my last commit.jim2001-02-171-0/+3 * Update to version 1.6.4.jim2001-02-172-2/+2 * Update to 1.6.3.jim2001-01-112-2/+2 * Update to version 1.6.2.jim2000-12-123-2/+11 * Update to version 1.6.1. This is a bug-fix release, and if you're usingjim2000-11-282-3/+2 * Bring in the SSL support from the xchat-devel port.jim2000-11-261-0/+5 * Bump PORTREVISION.jim2000-11-231-0/+1