Blob Blame History Raw
--- alexandria-0.6.8/lib/alexandria/export_library.rb.ruby19_csv	2012-05-30 10:04:18.167329943 +0900
+++ alexandria-0.6.8/lib/alexandria/export_library.rb	2012-05-30 10:07:52.230277906 +0900
@@ -241,7 +241,14 @@
       File.open(filename, 'w') do |io|
         io.puts "Title" + ';' + "Authors" + ';' + "Publisher" + ';' + "Edition" + ';' + "ISBN" + ';' + "Year Published" + ';' + "Rating" + "(0 to #{UI::MainApp::MAX_RATING_STARS.to_s})" + ';' + "Notes" + ';' + "Want?" + ';' + "Read?" + ';' + "Own?" + ';' + "Tags"
         each do |book|
-          io.puts book.title + ';' + book.authors.join(', ') + ';' + (book.publisher or "") + ';' + (book.edition or "") + ';' + (book.isbn or "") + ';' + (book.publishing_year.to_s or "") + ';' + (book.rating.to_s or "0") + ';' + (book.notes or "") + ';' + ( book.want ? "1" : "0") + ';' + ( book.redd ? "1" : "0") + ';' + ( book.own ? "1" : "0") + ';' + (book.tags ? book.tags.join(', ') : "")
+          io.puts book.title.force_encoding('UTF-8') + ';' +
+            book.authors.join(', ').force_encoding('UTF-8') + ';' +
+            (book.publisher or "").force_encoding('UTF-8') + ';' +
+            (book.edition or "").force_encoding('UTF-8') + ';' + (book.isbn or "") + ';' +
+            (book.publishing_year.to_s or "") + ';' + (book.rating.to_s or "0") + ';' +
+            (book.notes or "") + ';' + ( book.want ? "1" : "0") + ';' +
+            ( book.redd ? "1" : "0") + ';' + ( book.own ? "1" : "0") +
+            ';' + (book.tags ? book.tags.join(', ') : "")
         end
       end
     end
@@ -499,12 +506,12 @@
         if book.authors != []
           bibtex << book.authors[0]
           book.authors[1..-1].each do |author|
-            bibtex << " and #{latex_escape(author)}"
+            bibtex << " and #{latex_escape(author.force_encoding('UTF-8'))}"
           end
         end
         bibtex << "\",\n"
-        bibtex << "title = \"#{latex_escape(book.title)}\",\n"
-        bibtex << "publisher = \"#{latex_escape(book.publisher)}\",\n"
+        bibtex << "title = \"#{latex_escape(book.title.force_encoding('UTF-8'))}\",\n"
+        bibtex << "publisher = \"#{latex_escape(book.publisher.force_encoding('UTF-8'))}\",\n"
         if book.notes and not book.notes.empty?
           bibtex << "OPTnote = \"#{latex_escape(book.notes)}\",\n"
         end