diff options
Diffstat (limited to 'lib/rbot/core/utils/extends.rb')
-rw-r--r-- | lib/rbot/core/utils/extends.rb | 3 |
1 files changed, 2 insertions, 1 deletions
diff --git a/lib/rbot/core/utils/extends.rb b/lib/rbot/core/utils/extends.rb index 95569b71..5fa24dcb 100644 --- a/lib/rbot/core/utils/extends.rb +++ b/lib/rbot/core/utils/extends.rb @@ -55,6 +55,7 @@ class ::String if self.respond_to?(:http_headers) and headers = self.http_headers if headers['content-type'].first.match(/charset="?(\S+?)"?\s*;?/i) + debug "charset #{charset} set from header" charset = $1 end end @@ -66,10 +67,10 @@ class ::String when /<meta\s+http-equiv\s*=\s*"Content-Type".*charset\s*=\s*"?(\S+?)"?\s*;?/i charset = $1 end + debug "charset #{charset} set from string" end if charset - debug "charset: #{charset}" return Iconv.iconv('utf-8', charset, self).join rescue self else debug "Couldn't find charset for #{self.inspect}" |