summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authornaruse <naruse@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2009-10-16 03:04:38 +0000
committernaruse <naruse@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2009-10-16 03:04:38 +0000
commitee2512496cedaca3207d0ab0e7b12e81ac0ff27b (patch)
treec734ebb43f58c237050d3b1fffd864907a0ac495
parente0eb17f887c75abecdcceb2f1262646914708b29 (diff)
* lib/csv.rb (CSV#raw_encoding): returns ASCII-8BIT when the io
doesn't have encoding. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@25362 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
-rw-r--r--ChangeLog5
-rw-r--r--lib/csv.rb4
2 files changed, 8 insertions, 1 deletions
diff --git a/ChangeLog b/ChangeLog
index ea57286ff7..2c569b6a59 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,8 @@
+Fri Oct 16 12:03:31 2009 NARUSE, Yui <naruse@ruby-lang.org>
+
+ * 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@ruby-lang.org>
* lib/csv.rb (CSV#read_to_char): set encoding and verify data
diff --git a/lib/csv.rb b/lib/csv.rb
index 8545e661b1..d44e4db744 100644
--- a/lib/csv.rb
+++ b/lib/csv.rb
@@ -2288,8 +2288,10 @@ class CSV
@io.internal_encoding || @io.external_encoding
elsif @io.is_a? StringIO
@io.string.encoding
- else
+ elsif @io.respond_to? :encoding
@io.encoding
+ else
+ Encoding::ASCII_8BIT
end
end