Make sure encoding is stringified when passing to Nokogiri.