diff options
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 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 |