* lib/rss/converter.rb (RSS::Converter): use String#encode.
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@20079 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
This commit is contained in:
parent
b5a0eb6754
commit
ff5a076e7e
@ -1,3 +1,7 @@
|
|||||||
|
Fri Oct 31 21:58:50 2008 Kouhei Sutou <kou@cozmixng.org>
|
||||||
|
|
||||||
|
* lib/rss/converter.rb (RSS::Converter): use String#encode.
|
||||||
|
|
||||||
Fri Oct 31 21:28:14 2008 Yusuke Endoh <mame@tsg.ne.jp>
|
Fri Oct 31 21:28:14 2008 Yusuke Endoh <mame@tsg.ne.jp>
|
||||||
|
|
||||||
* lib/webrick/httpauth/digestauth.rb
|
* lib/webrick/httpauth/digestauth.rb
|
||||||
|
@ -7,6 +7,10 @@ module RSS
|
|||||||
include Utils
|
include Utils
|
||||||
|
|
||||||
def initialize(to_enc, from_enc=nil)
|
def initialize(to_enc, from_enc=nil)
|
||||||
|
if "".respond_to?(:encode)
|
||||||
|
@to_encoding = to_enc
|
||||||
|
return
|
||||||
|
end
|
||||||
normalized_to_enc = to_enc.downcase.gsub(/-/, '_')
|
normalized_to_enc = to_enc.downcase.gsub(/-/, '_')
|
||||||
from_enc ||= 'utf-8'
|
from_enc ||= 'utf-8'
|
||||||
normalized_from_enc = from_enc.downcase.gsub(/-/, '_')
|
normalized_from_enc = from_enc.downcase.gsub(/-/, '_')
|
||||||
@ -23,7 +27,11 @@ module RSS
|
|||||||
end
|
end
|
||||||
|
|
||||||
def convert(value)
|
def convert(value)
|
||||||
value
|
if value.is_a?(String) and value.respond_to?(:encode)
|
||||||
|
value.encode(@to_encoding)
|
||||||
|
else
|
||||||
|
value
|
||||||
|
end
|
||||||
end
|
end
|
||||||
|
|
||||||
def def_convert(depth=0)
|
def def_convert(depth=0)
|
||||||
|
Loading…
x
Reference in New Issue
Block a user