Blame alexandria-0.6.9-iconv.patch
|
|
ee63fe2 |
--- alexandria-0.6.9/lib/alexandria/book_providers/adlibris.rb.iconv 2009-12-22 06:49:50.000000000 +0900
|
|
|
ee63fe2 |
+++ alexandria-0.6.9/lib/alexandria/book_providers/adlibris.rb 2013-02-16 09:52:51.000000000 +0900
|
|
|
ee63fe2 |
@@ -26,7 +26,7 @@
|
|
|
ee63fe2 |
|
|
|
ee63fe2 |
require 'cgi'
|
|
|
ee63fe2 |
require 'alexandria/net'
|
|
|
ee63fe2 |
-require 'iconv'
|
|
|
ee63fe2 |
+#require 'iconv'
|
|
|
ee63fe2 |
|
|
|
ee63fe2 |
module Alexandria
|
|
|
ee63fe2 |
class BookProviders
|
|
|
ee63fe2 |
--- alexandria-0.6.9/lib/alexandria/book_providers/web.rb.iconv 2010-08-03 05:40:36.000000000 +0900
|
|
|
ee63fe2 |
+++ alexandria-0.6.9/lib/alexandria/book_providers/web.rb 2013-02-16 09:55:55.000000000 +0900
|
|
|
ee63fe2 |
@@ -17,7 +17,8 @@
|
|
|
ee63fe2 |
if source_data_charset == "UTF-8"
|
|
|
ee63fe2 |
utf8_html = html
|
|
|
ee63fe2 |
else
|
|
|
ee63fe2 |
- utf8_html = Iconv.conv("UTF-8", source_data_charset, html)
|
|
|
ee63fe2 |
+ #utf8_html = Iconv.conv("UTF-8", source_data_charset, html)
|
|
|
ee63fe2 |
+ utf8_html = html.encode("UTF-8", source_data_charset, :invalid => :replace, :replace => '')
|
|
|
ee63fe2 |
end
|
|
|
ee63fe2 |
normalized_html = @htmlentities.decode(utf8_html)
|
|
|
ee63fe2 |
Hpricot(normalized_html)
|