diff -ur galeon.orig/src/bookmarks_editor.c galeon/src/bookmarks_editor.c --- galeon.orig/src/bookmarks_editor.c Mon Sep 3 16:23:19 2001 +++ galeon/src/bookmarks_editor.c Wed Sep 5 23:56:07 2001 @@ -444,7 +444,7 @@ * it here, as GtkCLists and GtkEntries don't know about * accels */ tmp = strip_uline_accel (b->name); - loc_str = utf8_to_locale(tmp); + loc_str = mozilla_utf8_to_locale(tmp); text[0] = loc_str; g_free (tmp); text[1] = g_strdup (b->url); @@ -463,7 +463,7 @@ * it here, as GtkCLists and GtkEntries don't know about * accels */ tmp = strip_uline_accel (b->name); - loc_str = utf8_to_locale(tmp); + loc_str = mozilla_utf8_to_locale(tmp); text[0] = loc_str; g_free (tmp); text[1] = g_strdup (""); @@ -668,7 +668,7 @@ * it here, as GtkCLists and GtkEntries don't know about * accels */ tmp = strip_uline_accel (b->name); - loc_str = utf8_to_locale(tmp); + loc_str = mozilla_utf8_to_locale(tmp); text[0] = loc_str; g_free (tmp); text[1] = g_strdup (b->url); @@ -683,7 +683,7 @@ * it here, as GtkCLists and GtkEntries don't know about * accels */ tmp = strip_uline_accel (b->name); - loc_str = utf8_to_locale(tmp); + loc_str = mozilla_utf8_to_locale(tmp); text[0] = loc_str; g_free (tmp); text[1] = g_strdup (""); diff -ur galeon.orig/src/bookmarks_editor_callbacks.c galeon/src/bookmarks_editor_callbacks.c --- galeon.orig/src/bookmarks_editor_callbacks.c Mon Sep 3 16:23:19 2001 +++ galeon/src/bookmarks_editor_callbacks.c Wed Sep 5 23:56:07 2001 @@ -189,7 +189,7 @@ tmp1 = gtk_editable_get_chars (GTK_EDITABLE (controls->name_entry), 0, -1); tmp2 = escape_uline_accel (tmp1); - utf8_str = locale_to_utf8 (tmp2); + utf8_str = mozilla_locale_to_utf8 (tmp2); g_free (tmp2); g_free (tmp1); name = utf8_str; @@ -203,7 +203,7 @@ tmp1 = gtk_editable_get_chars (GTK_EDITABLE (controls->nick_entry), 0, -1); tmp2 = escape_uline_accel (tmp1); - utf8_str = locale_to_utf8 (tmp2); + utf8_str = mozilla_locale_to_utf8 (tmp2); g_free (tmp2); g_free (tmp1); nick = utf8_str; @@ -226,7 +226,7 @@ tmp1 = gtk_editable_get_chars (GTK_EDITABLE (controls->notes_text), 0, -1); tmp2 = escape_uline_accel (tmp1); - utf8_str = locale_to_utf8 (tmp2); + utf8_str = mozilla_locale_to_utf8 (tmp2); g_free (tmp2); g_free (tmp1); notes = utf8_str; @@ -996,7 +996,7 @@ if (bookmark && bookmark->name) { tmp = strip_uline_accel (bookmark->name); - loc_str = utf8_to_locale (tmp); + loc_str = mozilla_utf8_to_locale (tmp); } bookmarks_editor_set_text (controls->name_entry, @@ -1030,7 +1030,7 @@ if (!controls->nick_entry) return; if (bookmark) - loc_str = utf8_to_locale (bookmark->nick); + loc_str = mozilla_utf8_to_locale (bookmark->nick); bookmarks_editor_set_text (controls->nick_entry, loc_str, active); @@ -1101,7 +1101,7 @@ gtk_editable_delete_text (GTK_EDITABLE (control), 0, -1); if (active && bookmark && bookmark->notes) { - gchar *loc_str = utf8_to_locale (bookmark->notes); + gchar *loc_str = mozilla_utf8_to_locale (bookmark->notes); gtk_text_insert (GTK_TEXT (control), NULL, NULL, NULL, loc_str, strlen (bookmark->notes)); g_free (loc_str); diff -ur galeon.orig/src/bookmarks_menus.c galeon/src/bookmarks_menus.c --- galeon.orig/src/bookmarks_menus.c Wed Sep 5 13:57:02 2001 +++ galeon/src/bookmarks_menus.c Wed Sep 5 23:56:07 2001 @@ -235,7 +235,7 @@ submenu = gtk_menu_new (); gtk_menu_set_accel_group (GTK_MENU (submenu), menu->accel_group); - loc_str = utf8_to_locale (b->name); + loc_str = mozilla_utf8_to_locale (b->name); gtk_menu_set_title (GTK_MENU (submenu), loc_str); g_free (loc_str); mi = bookmarks_menu_create_item (b, menu, lock_accels); @@ -561,7 +561,7 @@ gchar *loc_str; gchar *stripped; - loc_str = utf8_to_locale (bookmark->name); + loc_str = mozilla_utf8_to_locale (bookmark->name); stripped = strip_uline_accel (loc_str); g_free (loc_str); @@ -717,7 +717,7 @@ if (bm->pixmap_data == NULL || bm->pixmap_data->pixmap == NULL) { - loc_str = utf8_to_locale (bm->name); + loc_str = mozilla_utf8_to_locale (bm->name); l = gtk_label_new (""); if (strlen (loc_str) > BOOKMARKS_MENU_MAX_LENGTH) { diff -ur galeon.orig/src/bookmarks_menus_callbacks.c galeon/src/bookmarks_menus_callbacks.c --- galeon.orig/src/bookmarks_menus_callbacks.c Sat Sep 1 22:29:08 2001 +++ galeon/src/bookmarks_menus_callbacks.c Wed Sep 5 23:56:07 2001 @@ -419,7 +419,7 @@ bookmarks_editor_place_tree_items (new); bookmarks_updated (); } else { - loc_str = utf8_to_locale (new->name); + loc_str = mozilla_utf8_to_locale (new->name); gnome_request_dialog (FALSE, _("Please enter the name of the bookmark"), loc_str, 100, diff -ur galeon.orig/src/bookmarks_toolbars.c galeon/src/bookmarks_toolbars.c --- galeon.orig/src/bookmarks_toolbars.c Tue Sep 4 07:27:01 2001 +++ galeon/src/bookmarks_toolbars.c Wed Sep 5 23:56:07 2001 @@ -427,7 +427,7 @@ if (b->pixmap_data == NULL || style == TOOLBAR_STYLE_TEXT_ONLY) { - gchar *loc_str = utf8_to_locale (b->name); + gchar *loc_str = mozilla_utf8_to_locale (b->name); name = strip_uline_accel (loc_str); g_free (loc_str); gtk_box_pack_start (GTK_BOX (box), gtk_label_new (name), @@ -460,7 +460,7 @@ } else { - gchar *loc_str = utf8_to_locale (b->notes); + gchar *loc_str = mozilla_utf8_to_locale (b->notes); if (b->type == BM_FOLDER) { tip = g_strdup_printf ("%s", loc_str); } diff -ur galeon.orig/src/mozilla/mozilla.cpp galeon/src/mozilla/mozilla.cpp --- galeon.orig/src/mozilla/mozilla.cpp Sat Sep 1 22:29:08 2001 +++ galeon/src/mozilla/mozilla.cpp Wed Sep 5 23:56:14 2001 @@ -1191,6 +1191,40 @@ return uniStr; } +extern "C" gchar * +mozilla_utf8_to_locale (const gchar* utfstr) +{ + if (utfstr == NULL) + { + return NULL; + } + PRUnichar* unistr = mozilla_utf8_to_unicode(utfstr); + if (unistr == NULL) + { + return NULL; + } + gchar* locstr = mozilla_unicode_to_locale(unistr); + g_free(unistr); + return locstr; +} + +extern "C" gchar * +mozilla_locale_to_utf8 (const gchar* locstr) +{ + if (locstr == NULL) + { + return NULL; + } + PRUnichar* unistr = mozilla_locale_to_unicode(locstr); + if (unistr == NULL) + { + return NULL; + } + gchar* utfstr = mozilla_unicode_to_utf8(unistr); + g_free(unistr); + return utfstr; +} + /** * mozilla_find_gtk_parent: retrives gtkwidget pointer to parent * of domWindow. It will be the gtkmozembed that holds it. diff -ur galeon.orig/src/mozilla/mozilla.h galeon/src/mozilla/mozilla.h --- galeon.orig/src/mozilla/mozilla.h Sat Sep 1 22:29:08 2001 +++ galeon/src/mozilla/mozilla.h Wed Sep 5 23:56:17 2001 @@ -188,4 +188,14 @@ #endif +#ifdef __cplusplus +extern "C" +{ +#endif +gchar *mozilla_utf8_to_locale (const gchar* utfstr); +gchar *mozilla_locale_to_utf8 (const gchar* utfstr); +#ifdef __cplusplus +} +#endif + #endif /* __mozilla_h */ diff -ur galeon.orig/src/panel.c galeon/src/panel.c --- galeon.orig/src/panel.c Thu Aug 30 18:03:36 2001 +++ galeon/src/panel.c Wed Sep 5 23:56:07 2001 @@ -253,7 +253,7 @@ { case BM_SITE: /* a site is an entry with a callback */ - loc_str = utf8_to_locale (bi->name); + loc_str = mozilla_utf8_to_locale (bi->name); applet_widget_register_callback (applet, name, loc_str, (AppletCallbackFunc) panel_applet_bookmark_activate_cb, bi); @@ -268,7 +268,7 @@ return; } /* a folder builds recursively */ - loc_str = utf8_to_locale (bi->name); + loc_str = mozilla_utf8_to_locale (bi->name); applet_widget_register_callback_dir (applet, name, loc_str); for (l = bi->list; l != NULL; l = g_list_next (l)) {