diff options
| author | naruse <naruse@b2dd03c8-39d4-4d8f-98ff-823fe69b080e> | 2009-10-16 03:04:38 +0000 |
|---|---|---|
| committer | naruse <naruse@b2dd03c8-39d4-4d8f-98ff-823fe69b080e> | 2009-10-16 03:04:38 +0000 |
| commit | bc486a224e8c8adece10877b559dd5e4e8c8312b (patch) | |
| tree | c734ebb43f58c237050d3b1fffd864907a0ac495 /lib | |
| parent | 7b9df604d64a5a48ecb9ba0343bd434c38459562 (diff) | |
| download | ruby-bc486a224e8c8adece10877b559dd5e4e8c8312b.tar.gz ruby-bc486a224e8c8adece10877b559dd5e4e8c8312b.tar.xz ruby-bc486a224e8c8adece10877b559dd5e4e8c8312b.zip | |
* lib/csv.rb (CSV#raw_encoding): returns ASCII-8BIT when the io
doesn't have encoding.
git-svn-id: http://svn.ruby-lang.org/repos/ruby/trunk@25362 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
Diffstat (limited to 'lib')
| -rw-r--r-- | lib/csv.rb | 4 |
1 files changed, 3 insertions, 1 deletions
diff --git a/lib/csv.rb b/lib/csv.rb index 8545e661b..d44e4db74 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 |
