I get the following error when running the code below:
invalid byte sequence in UTF-8 (ArgumentError)
The code:
require 'hpricot'
require 'open-uri'
doc = open('http://www.amazon.co.jp/') {|f| Hpricot(f.read) }
puts doc.to_html
Hpricot cannot parse the Japanese content. Any suggestions on fixing this issue?