From 736e73548cb39a7aaad61f01704ac60ccb74f79e Mon Sep 17 00:00:00 2001 From: 1 Date: Thu, 11 Oct 2001 22:07:28 +0000 Subject: bumped revision to .1 2001-10-11 * configure.in: bumped revision to .1 * gal/widgets/test-font-loading.c (print_gdk_font_name): Close iconv when done. * gal/widgets/e-unicode.c (e_utf8_to_gtk_string_sized): Close iconv when dont with it. (e_utf8_from_charset_string_sized): Changed for e_iconv api changes. (e_utf8_to_charset_string_sized): " (e_utf8_from_gtk_string_sized): Close iconv when done with it. (e_utf8_from_locale_string_sized): " (e_utf8_to_locale_string_sized): " * gal/widgets/e-font.c (e_locale_encoding): Removed. (e_iconv_from_charset): Removed. (e_iconv_to_charset): Removed. (e_iconv_from_locale): Removed. (e_iconv_to_locale): Removed. (e_iconv_from_gdk_font): Changd to use new e-iconv apis. (e_iconv_to_gdk_font): " (e_font_unref): Close iconv's when done with them. (translate_encoding): Removed. (get_locale_charset): Removed. (e_gdk_font_encoding): Fix for api changes. * gal/util/e-iconv.c: New stuff to commonify/fix up some problems with the iconv cache/conversion stuff inside e-font. svn path=/trunk/; revision=13601 --- widgets/misc/e-unicode.c | 33 +++++++++++++++++++++++++-------- 1 file changed, 25 insertions(+), 8 deletions(-) (limited to 'widgets') diff --git a/widgets/misc/e-unicode.c b/widgets/misc/e-unicode.c index 3e3344d37c..9fb780cf63 100644 --- a/widgets/misc/e-unicode.c +++ b/widgets/misc/e-unicode.c @@ -24,6 +24,7 @@ #include "e-font.h" #include #include +#include "gal/util/e-iconv.h" #define d(x) x @@ -336,12 +337,15 @@ gchar * e_utf8_from_charset_string_sized (const gchar *charset, const gchar *string, gint bytes) { iconv_t ic; + char *ret; if (!string) return NULL; - ic = e_iconv_from_charset (charset); + ic = e_iconv_open("utf-8", charset); + ret = e_utf8_from_iconv_string_sized (ic, string, bytes); + e_iconv_close(ic); - return e_utf8_from_iconv_string_sized (ic, string, bytes); + return ret; } gchar * @@ -355,12 +359,15 @@ gchar * e_utf8_to_charset_string_sized (const gchar *charset, const gchar *string, gint bytes) { iconv_t ic; + char *ret; if (!string) return NULL; - ic = e_iconv_to_charset (charset); + ic = e_iconv_open(charset, "utf-8"); + ret = e_utf8_to_iconv_string_sized (ic, string, bytes); + e_iconv_close(ic); - return e_utf8_to_iconv_string_sized (ic, string, bytes); + return ret; } gchar * @@ -442,6 +449,8 @@ e_utf8_from_gtk_string_sized (GtkWidget *widget, const gchar *string, gint bytes *ob = '\0'; + e_iconv_close(ic); + return new; } @@ -518,6 +527,8 @@ e_utf8_to_gtk_string_sized (GtkWidget *widget, const gchar *string, gint bytes) *ob = '\0'; + e_iconv_close(ic); + return new; } @@ -532,12 +543,15 @@ gchar * e_utf8_from_locale_string_sized (const gchar *string, gint bytes) { iconv_t ic; + char *ret; if (!string) return NULL; - ic = e_iconv_from_locale (); + ic = e_iconv_open("utf-8", e_iconv_locale_charset()); + ret = e_utf8_from_iconv_string_sized (ic, string, bytes); + e_iconv_close(ic); - return e_utf8_from_iconv_string_sized (ic, string, bytes); + return ret; } gchar * @@ -551,12 +565,15 @@ gchar * e_utf8_to_locale_string_sized (const gchar *string, gint bytes) { iconv_t ic; + char *ret; if (!string) return NULL; - ic = e_iconv_to_locale (); + ic = e_iconv_open(e_iconv_locale_charset(), "utf-8"); + ret = e_utf8_to_iconv_string_sized (ic, string, bytes); + e_iconv_close(ic); - return e_utf8_to_iconv_string_sized (ic, string, bytes); + return ret; } gchar * -- cgit v1.2.3