aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorDan Winship <danw@src.gnome.org>2000-11-30 04:36:00 +0800
committerDan Winship <danw@src.gnome.org>2000-11-30 04:36:00 +0800
commit87d218b24d399a0895865fd328da5bc4116353a1 (patch)
treed2a44c626dd1bed09d9c979a2f9b9b270c1c75a9
parentbb04a38e88b9a338ed9f4c7998a93e142f0c1bd6 (diff)
downloadgsoc2013-evolution-87d218b24d399a0895865fd328da5bc4116353a1.tar
gsoc2013-evolution-87d218b24d399a0895865fd328da5bc4116353a1.tar.gz
gsoc2013-evolution-87d218b24d399a0895865fd328da5bc4116353a1.tar.bz2
gsoc2013-evolution-87d218b24d399a0895865fd328da5bc4116353a1.tar.lz
gsoc2013-evolution-87d218b24d399a0895865fd328da5bc4116353a1.tar.xz
gsoc2013-evolution-87d218b24d399a0895865fd328da5bc4116353a1.tar.zst
gsoc2013-evolution-87d218b24d399a0895865fd328da5bc4116353a1.zip
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
-rw-r--r--widgets/misc/e-unicode.c34
1 files changed, 9 insertions, 25 deletions
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 <config.h>
#include <string.h>
#include <unicode.h>
+#include <iconv.h>
#include <gdk/gdk.h>
#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;