From 4fb41738f1d3ae0b050d203d7efffdd2f32864a6 Mon Sep 17 00:00:00 2001 From: jeg2 Date: Sun, 28 Sep 2008 00:06:21 +0000 Subject: * lib/csv/csv.rb: Worked around some minor encoding changes in Ruby pointed out by Nobu. git-svn-id: http://svn.ruby-lang.org/repos/ruby/trunk@19602 b2dd03c8-39d4-4d8f-98ff-823fe69b080e --- lib/csv.rb | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) (limited to 'lib') diff --git a/lib/csv.rb b/lib/csv.rb index ccfa6ab42..2cd4c17e9 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 -- cgit