From 87d218b24d399a0895865fd328da5bc4116353a1 Mon Sep 17 00:00:00 2001 From: Dan Winship Date: Wed, 29 Nov 2000 20:36:00 +0000 Subject: Move away from unicode_iconv*. We still need libunicode for utf8 strings functions, but that will go away eventually. * configure.in: Add a check for libiconv, which is required if your system doesn't have iconv in libc, or has glibc 2.1.2. Bump the gal version number to 0.2.99.3 * tests/Makefile.am (LDADD): add ICONV_LIBS * gal/widgets/Makefile.am (libwidgets_la_LDFLAGS): Add ICONV_LIBS * gal/widgets/e-unicode.c: Use iconv rather than libunicode for iconv()ing. (e_unicode_init): No longer needed * gal/widgets/e-font.c: Use iconv rather than libunicode for iconv()ing. (e_iconv_{from,to}_gdk_font): renamed from e_uiconv... * gal/widgets/test-e-font.c: No longer need to e_unicode_init(). svn path=/trunk/; revision=6719 --- widgets/misc/e-unicode.c | 34 +++++++++------------------------- 1 file changed, 9 insertions(+), 25 deletions(-) (limited to 'widgets/misc/e-unicode.c') diff --git a/widgets/misc/e-unicode.c b/widgets/misc/e-unicode.c index 7281404088..487bff5e9d 100644 --- a/widgets/misc/e-unicode.c +++ b/widgets/misc/e-unicode.c @@ -11,6 +11,7 @@ #include #include #include +#include #include #include "e-unicode.h" #include "e-font.h" @@ -21,23 +22,6 @@ static gint e_canonical_decomposition (unicode_char_t ch, unicode_char_t * buf); static unicode_char_t e_stripped_char (unicode_char_t ch); -void -e_unicode_init (void) -{ - static gboolean initialized = FALSE; - - if (!initialized) { - unicode_iconv_t hackhack; - - if ((hackhack = unicode_iconv_open("ASCII", "ASCII")) == (unicode_iconv_t) -1) - unicode_init (); - else - unicode_iconv_close(hackhack); - - initialized = TRUE; - } -} - /* * This my favourite * @@ -215,7 +199,7 @@ e_utf8_from_gtk_event_key (GtkWidget *widget, guint keyval, const gchar *string) gchar * e_utf8_from_gtk_string_sized (GtkWidget *widget, const gchar *string, gint bytes) { - unicode_iconv_t uiconv; + iconv_t ic; char *new, *ob; const gchar * ib; size_t ibl, obl; @@ -227,8 +211,8 @@ e_utf8_from_gtk_string_sized (GtkWidget *widget, const gchar *string, gint bytes g_return_val_if_fail (widget, NULL); - uiconv = e_uiconv_from_gdk_font (widget->style->font); - if (uiconv == (unicode_iconv_t) -1) return NULL; + ic = e_iconv_from_gdk_font (widget->style->font); + if (ic == (iconv_t) -1) return NULL; ib = string; ibl = bytes; @@ -236,7 +220,7 @@ e_utf8_from_gtk_string_sized (GtkWidget *widget, const gchar *string, gint bytes obl = ibl * 6 + 1; while (ibl > 0) { - unicode_iconv (uiconv, &ib, &ibl, &ob, &obl); + iconv (ic, &ib, &ibl, &ob, &obl); if (ibl > 0) { gint len; if ((*ib & 0x80) == 0x00) len = 1; @@ -269,7 +253,7 @@ e_utf8_from_gtk_string (GtkWidget *widget, const gchar *string) gchar * e_utf8_to_gtk_string_sized (GtkWidget *widget, const gchar *string, gint bytes) { - unicode_iconv_t uiconv; + iconv_t ic; char *new, *ob; const gchar * ib; size_t ibl, obl; @@ -278,8 +262,8 @@ e_utf8_to_gtk_string_sized (GtkWidget *widget, const gchar *string, gint bytes) g_return_val_if_fail (widget, NULL); - uiconv = e_uiconv_to_gdk_font (widget->style->font); - if (uiconv == (unicode_iconv_t) -1) return NULL; + ic = e_iconv_to_gdk_font (widget->style->font); + if (ic == (iconv_t) -1) return NULL; ib = string; ibl = bytes; @@ -287,7 +271,7 @@ e_utf8_to_gtk_string_sized (GtkWidget *widget, const gchar *string, gint bytes) obl = ibl * 4 + 1; while (ibl > 0) { - unicode_iconv (uiconv, &ib, &ibl, &ob, &obl); + iconv (ic, &ib, &ibl, &ob, &obl); if (ibl > 0) { gint len; if ((*ib & 0x80) == 0x00) len = 1; -- cgit v1.2.3