From 1ca457947eac5004f6af55d0d9a45cdc17790207 Mon Sep 17 00:00:00 2001 From: Jeffrey Stedfast Date: Wed, 11 Apr 2001 14:02:14 +0000 Subject: Use e_utf8_from_locale_string() rather than trying to do it manually since 2001-04-11 Jeffrey Stedfast * camel-pgp-context.c (camel_pgp_verify): Use e_utf8_from_locale_string() rather than trying to do it manually since Lauris's version works much better. svn path=/trunk/; revision=9236 --- camel/ChangeLog | 6 ++++++ camel/camel-pgp-context.c | 30 ++++-------------------------- 2 files changed, 10 insertions(+), 26 deletions(-) diff --git a/camel/ChangeLog b/camel/ChangeLog index 3cd2dbf8fd..8027680908 100644 --- a/camel/ChangeLog +++ b/camel/ChangeLog @@ -1,3 +1,9 @@ +2001-04-11 Jeffrey Stedfast + + * camel-pgp-context.c (camel_pgp_verify): Use + e_utf8_from_locale_string() rather than trying to do it manually + since Lauris's version works much better. + 2001-04-06 Jeffrey Stedfast * Makefile.am: Added camel-pgp-context.[c,h] to the build. Also diff --git a/camel/camel-pgp-context.c b/camel/camel-pgp-context.c index 4dad8909b9..53da66390b 100644 --- a/camel/camel-pgp-context.c +++ b/camel/camel-pgp-context.c @@ -31,6 +31,8 @@ #include /* for _() macro */ +#include + #include #include #include @@ -50,8 +52,6 @@ #include #include -#include - #ifdef ENABLE_THREADS #include #define PGP_LOCK(ctx) g_mutex_lock (((CamelPgpContext *) ctx)->priv->lock) @@ -1021,31 +1021,9 @@ camel_pgp_verify (CamelPgpContext *context, CamelStream *istream, } if (diagnostics) { - char *charset; - const char *buf; - char *desc, *outbuf; - iconv_t cd; - size_t len, outlen; - - charset = getenv ("CHARSET"); - if (!charset) - charset = "ISO-8859-1"; - - cd = iconv_open ("UTF-8", charset); - - len = strlen (diagnostics); - outlen = 2 * len; - - outbuf = desc = g_malloc0 (outlen + 1); - buf = diagnostics; - if (cd == (iconv_t) -1 || iconv (cd, &buf, &len, &outbuf, &outlen) == -1) { - g_free (desc); - desc = g_strdup (diagnostics); - } - - if (cd != (iconv_t) -1) - iconv_close (cd); + char *desc; + desc = e_utf8_from_locale_string (diagnostics); camel_pgp_validity_set_description (valid, desc); g_free (desc); } -- cgit v1.2.3