From 170588e217463591937bd86e93845a896dfe1317 Mon Sep 17 00:00:00 2001 From: Dan Winship Date: Fri, 21 Apr 2000 04:05:12 +0000 Subject: 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 --- camel/ChangeLog | 8 ++++++++ camel/camel-mime-utils.c | 23 +++++++++++++++-------- camel/camel.c | 2 ++ 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 + + * 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 * 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 + #include #include @@ -26,7 +28,7 @@ #include #include -#include +#include #include #include @@ -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 (); } -- cgit v1.2.3