aboutsummaryrefslogtreecommitdiffstats
path: root/camel/camel-mime-utils.c
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/camel-mime-utils.c
parent115bdd59278dbbc2111c88b80be065db72e08528 (diff)
downloadgsoc2013-evolution-170588e217463591937bd86e93845a896dfe1317.tar
gsoc2013-evolution-170588e217463591937bd86e93845a896dfe1317.tar.gz
gsoc2013-evolution-170588e217463591937bd86e93845a896dfe1317.tar.bz2
gsoc2013-evolution-170588e217463591937bd86e93845a896dfe1317.tar.lz
gsoc2013-evolution-170588e217463591937bd86e93845a896dfe1317.tar.xz
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/camel-mime-utils.c')
-rw-r--r--camel/camel-mime-utils.c23
1 files changed, 15 insertions, 8 deletions
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 ... */