ruby-changes:13581
From: naruse <ko1@a...>
Date: Fri, 16 Oct 2009 12:04:52 +0900 (JST)
Subject: [ruby-changes:13581] Ruby:r25362 (trunk): * lib/csv.rb (CSV#raw_encoding): returns ASCII-8BIT when the io
naruse 2009-10-16 12:04:38 +0900 (Fri, 16 Oct 2009) New Revision: 25362 http://svn.ruby-lang.org/cgi-bin/viewvc.cgi?view=rev&revision=25362 Log: * lib/csv.rb (CSV#raw_encoding): returns ASCII-8BIT when the io doesn't have encoding. Modified files: trunk/ChangeLog trunk/lib/csv.rb Index: ChangeLog =================================================================== --- ChangeLog (revision 25361) +++ ChangeLog (revision 25362) @@ -1,3 +1,8 @@ +Fri Oct 16 12:03:31 2009 NARUSE, Yui <naruse@r...> + + * lib/csv.rb (CSV#raw_encoding): returns ASCII-8BIT when the io + doesn't have encoding. + Fri Oct 16 03:15:52 2009 NARUSE, Yui <naruse@r...> * lib/csv.rb (CSV#read_to_char): set encoding and verify data Index: lib/csv.rb =================================================================== --- lib/csv.rb (revision 25361) +++ lib/csv.rb (revision 25362) @@ -2288,8 +2288,10 @@ @io.internal_encoding || @io.external_encoding elsif @io.is_a? StringIO @io.string.encoding + elsif @io.respond_to? :encoding + @io.encoding else - @io.encoding + Encoding::ASCII_8BIT end end -- ML: ruby-changes@q... Info: http://www.atdot.net/~ko1/quickml/