# File lib/mechanize/util.rb, line 29 def from_native_charset(s, code) return s unless s && code return s unless Mechanize.html_parser == Nokogiri::HTML begin Iconv.iconv(code.to_s, "UTF-8", s).join("") rescue Iconv::InvalidEncoding s end end