From 247a808a5bde5b7c9ea05d2966e47c927f347ccf Mon Sep 17 00:00:00 2001 From: Jon Trowbridge Date: Sat, 21 Apr 2001 19:00:23 +0000 Subject: Properly convert to utf8. (Bug #2256) (build_quick_add_dialog): Properly 2001-04-21 Jon Trowbridge * contact-editor/e-contact-quick-add.c (clicked_cb): Properly convert to utf8. (Bug #2256) (build_quick_add_dialog): Properly convert from utf8. (Bug #2256) svn path=/trunk/; revision=9485 --- .../gui/contact-editor/e-contact-quick-add.c | 26 +++++++++++++++++----- 1 file changed, 20 insertions(+), 6 deletions(-) (limited to 'addressbook/gui/contact-editor') diff --git a/addressbook/gui/contact-editor/e-contact-quick-add.c b/addressbook/gui/contact-editor/e-contact-quick-add.c index 0ab39701d3..f9556f6758 100644 --- a/addressbook/gui/contact-editor/e-contact-quick-add.c +++ b/addressbook/gui/contact-editor/e-contact-quick-add.c @@ -36,6 +36,7 @@ #include #include #include +#include #include #include #include @@ -179,10 +180,19 @@ clicked_cb (GtkWidget *w, gint button, gpointer user_data) name_entry = gtk_object_get_data (GTK_OBJECT (card), "e-contact-quick-add-name-entry"); email_entry = gtk_object_get_data (GTK_OBJECT (card), "e-contact-quick-add-email-entry"); - if (name_entry) - name = gtk_editable_get_chars (GTK_EDITABLE (name_entry), 0, -1); - if (email_entry) - email = gtk_editable_get_chars (GTK_EDITABLE (email_entry), 0, -1); + if (name_entry) { + gchar *tmp; + tmp = gtk_editable_get_chars (GTK_EDITABLE (name_entry), 0, -1); + name = e_utf8_from_gtk_string (name_entry, tmp); + g_free (tmp); + } + + if (email_entry) { + gchar *tmp; + tmp = gtk_editable_get_chars (GTK_EDITABLE (email_entry), 0, -1); + email = e_utf8_from_gtk_string (email_entry, tmp); + g_free (tmp); + } e_card_quick_set_name (card, name); e_card_quick_set_email (card, email); @@ -235,8 +245,10 @@ build_quick_add_dialog (ECard *new_card, EContactQuickAddCallback cb, gpointer u if (new_card->name) { gchar *str = e_card_name_to_string (new_card->name); - gtk_entry_set_text (GTK_ENTRY (name_entry), str); + gchar *s2 = e_utf8_to_gtk_string (name_entry, str); + gtk_entry_set_text (GTK_ENTRY (name_entry), s2); g_free (str); + g_free (s2); } @@ -248,7 +260,9 @@ build_quick_add_dialog (ECard *new_card, EContactQuickAddCallback cb, gpointer u e_iterator_reset (iterator); if (e_iterator_is_valid (iterator)) { const gchar *str = e_iterator_get (iterator); - gtk_entry_set_text (GTK_ENTRY (email_entry), str); + gchar *s2 = e_utf8_to_gtk_string (email_entry, str); + gtk_entry_set_text (GTK_ENTRY (email_entry), s2); + g_free (s2); } } } -- cgit v1.2.3