# File lib/mechanize/util.rb, line 54 def detect_charset(src) tmp = NKF.guess(src || "<html></html>") if RUBY_VERSION >= "1.9.0" enc = tmp.to_s.upcase else enc = NKF.constants.find{|c| NKF.const_get(c) == tmp } enc = CODE_DIC[enc.intern] end enc || "ISO-8859-1" end