aboutsummaryrefslogtreecommitdiffstats
path: root/widgets/misc/e-unicode.c
diff options
context:
space:
mode:
author1 <NotZed@Ximian.com>2001-10-12 06:07:28 +0800
committerMichael Zucci <zucchi@src.gnome.org>2001-10-12 06:07:28 +0800
commit736e73548cb39a7aaad61f01704ac60ccb74f79e (patch)
tree1795238b59dfba4370d1972d17092a1c8daccf59 /widgets/misc/e-unicode.c
parentd965c00a22feafbb505a78d1414baa5e2ea39bb8 (diff)
downloadgsoc2013-evolution-736e73548cb39a7aaad61f01704ac60ccb74f79e.tar
gsoc2013-evolution-736e73548cb39a7aaad61f01704ac60ccb74f79e.tar.gz
gsoc2013-evolution-736e73548cb39a7aaad61f01704ac60ccb74f79e.tar.bz2
gsoc2013-evolution-736e73548cb39a7aaad61f01704ac60ccb74f79e.tar.lz
gsoc2013-evolution-736e73548cb39a7aaad61f01704ac60ccb74f79e.tar.xz
gsoc2013-evolution-736e73548cb39a7aaad61f01704ac60ccb74f79e.tar.zst
gsoc2013-evolution-736e73548cb39a7aaad61f01704ac60ccb74f79e.zip
bumped revision to .1
2001-10-11 <NotZed@Ximian.com> * 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
Diffstat (limited to 'widgets/misc/e-unicode.c')
-rw-r--r--widgets/misc/e-unicode.c33
1 files changed, 25 insertions, 8 deletions
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 <gnome-xml/xmlmemory.h>
#include <stdlib.h>
+#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 *