Re: addresses from balsa-ab are not encoded properly



Ildar:

On 08/13/2009 12:03:11 AM Thu, Ildar Mulyukov wrote:
	Hi, Peter!
You do everything right. I can't figure out why the bug didn't appear on your site.
What I do:
1. New message
2. type b in To: field
3. choose Бальса-лист <balsa-list gnome org> from the drop-down
4. Save the message
5. Open the message Drafts
6. View Source.
I see
To: \320\221\320\260\320\273\321\214\321\201\320\260-\320\273\320\270\321\201\321\202 <balsa-list gnome org>

The entry is from the Balsa VCard addr.book. I don't think it's locale-related, as I could reproduce it in LANG=C.

If you paste the address directly into the address field, does the same thing happen? Looking over the code, I don't see any place where an address grabbed from an address book is handled any differently from one that's typed or pasted in, as far as encoding is concerned.

P.S. recent time balsa complains in the run-time:
(balsa:9399): Gdk-CRITICAL **: gdk_x11_atom_to_xatom_for_display: assertion `atom != GDK_NONE' failed
Cannot open: unable to open database file
Do you have a good explanation for this?

Sadly, no! The Gdk-CRITICAL warning occurs when Balsa (or any other app) uses gtk_dialog_run() to present a modal dialog. <URL:http://mail.gnome.org/archives/gtk-list/2009-June/msg00017.html> suggests that it should be fixed in some gtk update, but I'm still seeing it in 2.16.5.

The "Cannot open:" string is in Balsa's GPE (sqlite) address book code, in a section handling errors in sqlite3_open(). Do you see that error in a predictable way? If so, could you apply the attached patch? It doesn't fix anything, just adds the database file name to the error message, but that might help diagnose it.

Thanks!

Peter
diff --git a/libbalsa/address-book-gpe.c b/libbalsa/address-book-gpe.c
index efbad1a..afc61fe 100644
--- a/libbalsa/address-book-gpe.c
+++ b/libbalsa/address-book-gpe.c
@@ -196,21 +196,21 @@ libbalsa_address_book_gpe_open_db(LibBalsaAddressBookGpe * ab)
 {
 #ifdef HAVE_SQLITE3
     gchar *dir, *name;
-    int r;
 
     dir = g_build_filename(g_get_home_dir(), ".gpe", NULL);
     mkdir(dir, S_IRUSR|S_IWUSR|S_IXUSR);
     name = g_build_filename(dir, "contacts", NULL);
     g_free(dir);
-    r = sqlite3_open(name, &ab->db);
-    g_free(name);
 
-    if (r != SQLITE_OK) {
-        printf("Cannot open: %s\n", sqlite3_errmsg(ab->db));
+    if (sqlite3_open(name, &ab->db) != SQLITE_OK) {
+        printf("Cannot open \"%s\": %s\n", name, sqlite3_errmsg(ab->db));
+        g_free(name);
         sqlite3_close(ab->db);
         ab->db = NULL;
         return 0;
     }
+    g_free(name);
+
     sqlite3_exec(ab->db, schema_str,  NULL, NULL, NULL);
     sqlite3_exec(ab->db, schema2_str, NULL, NULL, NULL);
 #else                           /* HAVE_SQLITE3 */


[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]