* lib/open-uri.rb (OpenURI::Meta#meta_setup_encoding): use ASCII-8BIT
for charset unspecified non-text data. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@15633 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
This commit is contained in:
parent
5eafc201d8
commit
3e1c54defd
@ -1,3 +1,8 @@
|
|||||||
|
Thu Feb 28 23:37:12 2008 Tanaka Akira <akr@fsij.org>
|
||||||
|
|
||||||
|
* lib/open-uri.rb (OpenURI::Meta#meta_setup_encoding): use ASCII-8BIT
|
||||||
|
for charset unspecified non-text data.
|
||||||
|
|
||||||
Thu Feb 28 22:19:14 2008 NARUSE, Yui <naruse@ruby-lang.org>
|
Thu Feb 28 22:19:14 2008 NARUSE, Yui <naruse@ruby-lang.org>
|
||||||
|
|
||||||
* encoding.c (enc_capable): IMMEDIATE_P doesn't include Qnil and Qfalse.
|
* encoding.c (enc_capable): IMMEDIATE_P doesn't include Qnil and Qfalse.
|
||||||
|
@ -414,12 +414,14 @@ module OpenURI
|
|||||||
|
|
||||||
def meta_setup_encoding # :nodoc:
|
def meta_setup_encoding # :nodoc:
|
||||||
charset = self.charset
|
charset = self.charset
|
||||||
return unless charset
|
enc = nil
|
||||||
begin
|
if charset
|
||||||
enc = Encoding.find(charset)
|
begin
|
||||||
rescue ArgumentError
|
enc = Encoding.find(charset)
|
||||||
return
|
rescue ArgumentError
|
||||||
|
end
|
||||||
end
|
end
|
||||||
|
enc = Encoding::ASCII_8BIT unless enc
|
||||||
if self.respond_to? :force_encoding
|
if self.respond_to? :force_encoding
|
||||||
self.force_encoding(enc)
|
self.force_encoding(enc)
|
||||||
elsif self.respond_to? :string
|
elsif self.respond_to? :string
|
||||||
|
Loading…
x
Reference in New Issue
Block a user