diff options
author | jeg2 <jeg2@b2dd03c8-39d4-4d8f-98ff-823fe69b080e> | 2008-09-28 00:06:21 +0000 |
---|---|---|
committer | jeg2 <jeg2@b2dd03c8-39d4-4d8f-98ff-823fe69b080e> | 2008-09-28 00:06:21 +0000 |
commit | bde8a01d0a8750f9e0a7728ee9ae3a0fea3001ed (patch) | |
tree | af8e1e9377611980e36dd4019cb1c4cb43a47d0e /lib/csv.rb | |
parent | 356b051532c583e37c24c3f1f450013a1732556e (diff) |
* lib/csv/csv.rb: Worked around some minor encoding changes in Ruby
pointed out by Nobu.
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@19602 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
Diffstat (limited to 'lib/csv.rb')
-rw-r--r-- | lib/csv.rb | 8 |
1 files changed, 4 insertions, 4 deletions
diff --git a/lib/csv.rb b/lib/csv.rb index ccfa6ab42f..2cd4c17e98 100644 --- a/lib/csv.rb +++ b/lib/csv.rb @@ -199,7 +199,7 @@ require "stringio" # class CSV # The version of the installed library. - VERSION = "2.4.1".freeze + VERSION = "2.4.2".freeze # # A CSV::Row is part Array and part Hash. It retains an order for the fields @@ -831,7 +831,7 @@ class CSV # Shows the mode and size of this table in a US-ASCII String. def inspect - "#<#{self.class} mode:#{@mode} row_count:#{to_a.size}>" + "#<#{self.class} mode:#{@mode} row_count:#{to_a.size}>".encode("US-ASCII") end end @@ -1244,9 +1244,9 @@ class CSV encoding = options.delete(:encoding) str = "" if encoding - str.encode!(encoding) + str.force_encoding(encoding) elsif field = row.find { |f| not f.nil? } - str.encode!(String(field).encoding) + str.force_encoding(String(field).encoding) end (new(str, options) << row).string end |