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