[alexandria] More UTF-8 fix on ruby 1.9, when exporting library to HTML

Mamoru Tasaka mtasaka at fedoraproject.org
Sat May 5 17:24:39 UTC 2012


commit 9303cdc1c2c6bb88330a8c6107a7a1bcca37b062
Author: Mamoru Tasaka <tasaka1 at localhost.localdomain>
Date:   Sun May 6 02:24:36 2012 +0900

    More UTF-8 fix on ruby 1.9, when exporting library to HTML
    
     (bug 819188)

 alexandria-0.6.8-export-to-HTML-with-ruby19.patch |   45 +++++++++++++++++++++
 alexandria.spec                                   |   10 ++++-
 clog                                              |    6 +--
 3 files changed, 56 insertions(+), 5 deletions(-)
---
diff --git a/alexandria-0.6.8-export-to-HTML-with-ruby19.patch b/alexandria-0.6.8-export-to-HTML-with-ruby19.patch
new file mode 100644
index 0000000..dec5c0b
--- /dev/null
+++ b/alexandria-0.6.8-export-to-HTML-with-ruby19.patch
@@ -0,0 +1,45 @@
+--- alexandria-0.6.8/lib/alexandria/export_library.rb.export	2009-03-26 08:09:32.000000000 +0900
++++ alexandria-0.6.8/lib/alexandria/export_library.rb	2012-05-06 01:22:03.000000000 +0900
+@@ -420,7 +420,7 @@
+           xhtml << <<EOS
+   <img class="book_cover"
+        src="#{File.join("pixmaps", final_cover(book))}"
+-       alt="Cover file for '#{xhtml_escape(book.title)}'"
++       alt="Cover file for '#{xhtml_escape(book.title).force_encoding("UTF-8")}'"
+ EOS
+           if $IMAGE_SIZE_LOADED
+             image_s = ImageSize.new(IO.read(cover(book)))
+@@ -439,7 +439,7 @@
+ 
+         unless book.title == nil
+           xhtml << <<EOS
+-<p class="book_title">#{xhtml_escape(book.title)}</p>
++<p class="book_title">#{xhtml_escape(book.title).force_encoding("UTF-8")}</p>
+ EOS
+         end
+ 
+@@ -447,7 +447,7 @@
+           xhtml << "<ul class=\"book_authors\">"
+           book.authors.each do |author|
+             xhtml << <<EOS
+-<li class="book_author">#{xhtml_escape(author)}</li>
++<li class="book_author">#{xhtml_escape(author).force_encoding("UTF-8")}</li>
+ EOS
+           end
+           xhtml << "</ul>"
+@@ -455,13 +455,13 @@
+ 
+         unless book.edition == nil
+           xhtml << <<EOS
+-<p class="book_binding">#{xhtml_escape(book.edition)}</p>
++<p class="book_binding">#{xhtml_escape(book.edition).force_encoding("UTF-8")}</p>
+ EOS
+         end
+ 
+         unless book.publisher == nil
+           xhtml << <<EOS
+-<p class="book_publisher">#{xhtml_escape(book.publisher)}</p>
++<p class="book_publisher">#{xhtml_escape(book.publisher).force_encoding("UTF-8")}</p>
+ EOS
+         end
+ 
diff --git a/alexandria.spec b/alexandria.spec
index 5369b3f..c80d247 100644
--- a/alexandria.spec
+++ b/alexandria.spec
@@ -9,7 +9,7 @@
 %undefine		minorver	
 %undefine		ifpre	
 
-%define		fedorarel	6
+%define		fedorarel	7
 %define		rel		%{?ifpre:0.}%{fedorarel}%{?minorver:.%minorver}
 
 
@@ -62,6 +62,9 @@ Patch17:	alexandria-0.6.8-z3950-next.patch
 # b. moving book entry to another library which also contains the
 #    same book will cause crash..
 Patch18:	alexandria-0.6.8-utf8-convert.patch
+# More UTF-8 fix on ruby 1.9, when exporting library to HTML
+# (bug 819188)
+Patch19:	alexandria-0.6.8-export-to-HTML-with-ruby19.patch
 
 BuildArch:	noarch
 BuildRequires:	ruby(abi) >= %{rubyabi}
@@ -130,6 +133,7 @@ Alexandria is a GNOME application to help you manage your book collection.
 %patch16 -p1 -b .evalfix
 %patch17 -p1 -b .z3950_next
 %patch18 -p1 -b .ruby19_utf8
+%patch19 -p1 -b .export
 
 # Embed Fedora EVR
 %{__sed} -i.evr \
@@ -224,6 +228,10 @@ exit 0
 %{_datadir}/icons/hicolor/*/apps/%{name}.*
 
 %changelog
+* Sun May  6 2012 Mamoru Tasaka <mtasaka at fedoraproject.org> - 0.8.6-7
+- More UTF-8 fix on ruby 1.9, when exporting library to HTML
+ (bug 819188)
+
 * Fri Apr 13 2012 Mamoru Tasaka <mtasaka at fedoraproject.org> - 0.6.8-6
 - Convert escaped characters in yaml file generated by ruby 18x to
   aviod garbage characters
diff --git a/clog b/clog
index bbe34a5..52eeb70 100644
--- a/clog
+++ b/clog
@@ -1,5 +1,3 @@
-Convert escaped characters in yaml file generated by ruby 18x to
+More UTF-8 fix on ruby 1.9, when exporting library to HTML
 
-  aviod garbage characters
-- Fix crash when moving book entry to another library when the same
-  entry is found
+ (bug 819188)


More information about the scm-commits mailing list