How to convert a Net::HTTP response to a certain encoding in Ruby 1.9.1?
I have a Sinatra application ( http://analyzethis.espace-technologies.com ) that does the following Retrieve an HTML page (via net/http) Create a Nokogiri document from the response.body Extract some info and send it back in the response. The response should be UTF-8 encoded So I came to the problem while trying to read sites that use windows-1256 encodings like www.filfan.com or www.masrawy.com. The problem is the result of the encoding conversion is not correct though no errors are thrown. The net/http response.body.encoding gives ASCII-8BIT which can not be converted to UTF-8 If I do