I\'m using Nokogiri and open-uri to grab the contents of the title tag on a webpage, but am having trouble with accented characters. What\'s the best way to deal with these
Try setting the encoding option of Nokogiri, like so:
require 'open-uri' require 'nokogiri' doc = Nokogiri::HTML(open(link)) doc.encoding = 'utf-8' title = doc.at_css("title")