Blob Blame History Raw
--- alexandria-0.6.8/lib/alexandria/ui/dialogs/misc_dialogs.rb.ruby19_utf8	2009-03-26 08:09:32.000000000 +0900
+++ alexandria-0.6.8/lib/alexandria/ui/dialogs/misc_dialogs.rb	2012-04-13 12:38:05.065369194 +0900
@@ -22,9 +22,11 @@
       GetText.bindtextdomain(Alexandria::TEXTDOMAIN, :charset => "UTF-8")
 
       def initialize(parent, library, book)
+        # Don't know why, however force_encoding seems needed here to
+        # prevent crash...
         super(parent,
               _("The book '%s' already exists in '%s'. Would you like " +
-                "to replace it?") % [ book.title, library.name ],
+                "to replace it?") % [ book.title, library.name ].dup.map!{|str| str.force_encoding("UTF-8")},
               Gtk::Stock::DIALOG_QUESTION,
               [[_("_Skip"), Gtk::Dialog::RESPONSE_CANCEL],
                [_("_Replace"), Gtk::Dialog::RESPONSE_OK]],
--- alexandria-0.6.8/lib/alexandria/ui/ui_manager.rb.ruby19_utf8	2011-11-15 22:09:19.000000000 +0900
+++ alexandria-0.6.8/lib/alexandria/ui/ui_manager.rb	2012-04-13 12:38:05.066369229 +0900
@@ -825,7 +825,9 @@
         iter[Columns::TITLE] = book.title
         title = book.title.sub(REDUCE_TITLE_REGEX, '\1...')
         iter[Columns::TITLE_REDUCED] = title
-        iter[Columns::AUTHORS] = book.authors.join(', ')
+        # Don't know why, however force_encoding seems needed here to
+        # prevent crash...
+        iter[Columns::AUTHORS] = book.authors.dup.map!{|str| str.force_encoding("UTF-8")}.join(', ')
         iter[Columns::ISBN] = book.isbn.to_s
         iter[Columns::PUBLISHER] = book.publisher
         iter[Columns::PUBLISH_DATE] = (book.publishing_year.to_s rescue "")