aboutsummaryrefslogtreecommitdiffstats
path: root/camel
diff options
context:
space:
mode:
authorDan Winship <danw@src.gnome.org>2000-04-21 12:05:12 +0800
committerDan Winship <danw@src.gnome.org>2000-04-21 12:05:12 +0800
commit170588e217463591937bd86e93845a896dfe1317 (patch)
tree5a95311889f73daee24dc1bcf960bd8ad3dcc01b /camel
parent115bdd59278dbbc2111c88b80be065db72e08528 (diff)
downloadgsoc2013-evolution-170588e217463591937bd86e93845a896dfe1317.tar.gz
gsoc2013-evolution-170588e217463591937bd86e93845a896dfe1317.tar.zst
gsoc2013-evolution-170588e217463591937bd86e93845a896dfe1317.zip
use libunicode iconv functions rather than libc ones (since libc might not
* camel-mime-utils.c (rfc2047_decode_word): use libunicode iconv functions rather than libc ones (since libc might not have them). (header_decode_date): add autoconfiscation on timezone code * camel.c (camel_init): call unicode_init () svn path=/trunk/; revision=2540
Diffstat (limited to 'camel')
-rw-r--r--camel/ChangeLog8
-rw-r--r--camel/camel-mime-utils.c23
-rw-r--r--camel/camel.c2
3 files changed, 25 insertions, 8 deletions
diff --git a/camel/ChangeLog b/camel/ChangeLog
index f868744547..dd90161a19 100644
--- a/camel/ChangeLog
+++ b/camel/ChangeLog
@@ -1,3 +1,11 @@
+2000-04-20 Dan Winship <danw@helixcode.com>
+
+ * camel-mime-utils.c (rfc2047_decode_word): use libunicode iconv
+ functions rather than libc ones (since libc might not have them).
+ (header_decode_date): add autoconfiscation on timezone code
+
+ * camel.c (camel_init): call unicode_init ()
+
2000-04-20 NotZed <NotZed@HelixCode.com>
* providers/mbox/camel-mbox-summary.c (message_struct_new): Trim
diff --git a/camel/camel-mime-utils.c b/camel/camel-mime-utils.c
index d3e2406f1a..94ede343e6 100644
--- a/camel/camel-mime-utils.c
+++ b/camel/camel-mime-utils.c
@@ -18,6 +18,8 @@
* Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
*/
+#include <config.h>
+
#include <stdio.h>
#include <sys/types.h>
@@ -26,7 +28,7 @@
#include <stdlib.h>
#include <string.h>
-#include <iconv.h>
+#include <unicode.h>
#include <glib.h>
#include <time.h>
@@ -641,7 +643,7 @@ rfc2047_decode_word(char *in, int len)
char *outbase = NULL;
char *inbuf, *outbuf;
int inlen, outlen;
- iconv_t ic;
+ unicode_iconv_t ic;
d(printf("decoding '%.*s'\n", len, in));
@@ -684,9 +686,9 @@ rfc2047_decode_word(char *in, int len)
outbase = g_malloc(outlen);
outbuf = outbase;
- ic = iconv_open("utf-8", encname);
- ret = iconv(ic, (const char **)&inbuf, &inlen, &outbuf, &outlen);
- iconv_close(ic);
+ ic = unicode_iconv_open("utf-8", encname);
+ ret = unicode_iconv(ic, (const char **)&inbuf, &inlen, &outbuf, &outlen);
+ unicode_iconv_close(ic);
if (ret>=0) {
*outbuf = 0;
decoded = outbase;
@@ -1650,9 +1652,14 @@ header_decode_date(const char *in, int *saveoffset)
d(printf("named offset = %d\n", offset));
}
- /* t -= ( (offset/100) * 60*60) + (offset % 100)*60 + timezone;*/
-
- t = mktime(&tm) - timezone;
+ t = mktime(&tm);
+#if defined(HAVE_TIMEZONE)
+ t -= timezone;
+#elif defined(HAVE_TM_GMTOFF)
+ t += tm.tm_gmtoff;
+#else
+#error Neither HAVE_TIMEZONE nor HAVE_TM_GMTOFF defined. Rerun autoheader, autoconf, etc.
+#endif
/* t is now GMT of the time we want, but not offset by the timezone ... */
diff --git a/camel/camel.c b/camel/camel.c
index 47efb9ffbb..56d2056db0 100644
--- a/camel/camel.c
+++ b/camel/camel.c
@@ -39,5 +39,7 @@ camel_init(void)
#endif /* G_THREADS_ENABLED */
#endif /* ENABLE_THREADS */
+ unicode_init ();
+
return data_wrapper_repository_init ();
}