ruby-changes:4143
From: ko1@a...
Date: Thu, 28 Feb 2008 23:38:53 +0900 (JST)
Subject: [ruby-changes:4143] akr - Ruby:r15633 (trunk): * lib/open-uri.rb (OpenURI::Meta#meta_setup_encoding): use ASCII-8BIT
akr 2008-02-28 23:38:33 +0900 (Thu, 28 Feb 2008)
New Revision: 15633
Modified files:
trunk/ChangeLog
trunk/lib/open-uri.rb
Log:
* lib/open-uri.rb (OpenURI::Meta#meta_setup_encoding): use ASCII-8BIT
for charset unspecified non-text data.
http://svn.ruby-lang.org/cgi-bin/viewvc.cgi/trunk/ChangeLog?r1=15633&r2=15632&diff_format=u
http://svn.ruby-lang.org/cgi-bin/viewvc.cgi/trunk/lib/open-uri.rb?r1=15633&r2=15632&diff_format=u
Index: ChangeLog
===================================================================
--- ChangeLog (revision 15632)
+++ ChangeLog (revision 15633)
@@ -1,3 +1,8 @@
+Thu Feb 28 23:37:12 2008 Tanaka Akira <akr@f...>
+
+ * 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@r...>
* encoding.c (enc_capable): IMMEDIATE_P doesn't include Qnil and Qfalse.
Index: lib/open-uri.rb
===================================================================
--- lib/open-uri.rb (revision 15632)
+++ lib/open-uri.rb (revision 15633)
@@ -414,12 +414,14 @@
def meta_setup_encoding # :nodoc:
charset = self.charset
- return unless charset
- begin
- enc = Encoding.find(charset)
- rescue ArgumentError
- return
+ enc = nil
+ if charset
+ begin
+ enc = Encoding.find(charset)
+ rescue ArgumentError
+ end
end
+ enc = Encoding::ASCII_8BIT unless enc
if self.respond_to? :force_encoding
self.force_encoding(enc)
elsif self.respond_to? :string
--
ML: ruby-changes@q...
Info: http://www.atdot.net/~ko1/quickml/