Use e_utf8_from_locale_string() rather than trying to do it manually since

2001-04-11  Jeffrey Stedfast  <fejj@ximian.com>

	* 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
This commit is contained in:
Jeffrey Stedfast
2001-04-11 14:02:14 +00:00
committed by Jeffrey Stedfast
parent 14c14d8dc0
commit 1ca457947e
2 changed files with 10 additions and 26 deletions

View File

@ -1,3 +1,9 @@
2001-04-11 Jeffrey Stedfast <fejj@ximian.com>
* 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 <fejj@ximian.com>
* Makefile.am: Added camel-pgp-context.[c,h] to the build. Also

View File

@ -31,6 +31,8 @@
#include <gtk/gtk.h> /* for _() macro */
#include <gal/widgets/e-unicode.h>
#include <stdio.h>
#include <stdlib.h>
#include <string.h>
@ -50,8 +52,6 @@
#include <unistd.h>
#include <signal.h>
#include <iconv.h>
#ifdef ENABLE_THREADS
#include <pthread.h>
#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);
}