From d05217109fb5e909bbd7849bcc799b6404c7c8b0 Mon Sep 17 00:00:00 2001 From: nobu Date: Sat, 25 Dec 2010 06:58:58 +0000 Subject: * lib/csv.rb, test/csv: should not assume $, invariant. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@30353 b2dd03c8-39d4-4d8f-98ff-823fe69b080e --- lib/csv.rb | 14 +++++++------- 1 file changed, 7 insertions(+), 7 deletions(-) (limited to 'lib/csv.rb') diff --git a/lib/csv.rb b/lib/csv.rb index 31388bc9da..1ad019a269 100644 --- a/lib/csv.rb +++ b/lib/csv.rb @@ -505,12 +505,12 @@ class CSV end str << ">" begin - str.join + str.join('') rescue # any encoding error str.map do |s| e = Encoding::Converter.asciicompat_encoding(s.encoding) e ? s.encode(e) : s.force_encoding("ASCII-8BIT") - end.join + end.join('') end end end @@ -845,7 +845,7 @@ class CSV else rows + [row.fields.to_csv(options)] end - end.join + end.join('') end alias_method :to_s, :to_csv @@ -1973,12 +1973,12 @@ class CSV end str << ">" begin - str.join + str.join('') rescue # any encoding error str.map do |s| e = Encoding::Converter.asciicompat_encoding(s.encoding) e ? s.encode(e) : s.force_encoding("ASCII-8BIT") - end.join + end.join('') end end @@ -2262,7 +2262,7 @@ class CSV # a backslash cannot be transcoded. # def escape_re(str) - str.chars.map { |c| @re_chars.include?(c) ? @re_esc + c : c }.join + str.chars.map { |c| @re_chars.include?(c) ? @re_esc + c : c }.join('') end # @@ -2278,7 +2278,7 @@ class CSV # that encoding. # def encode_str(*chunks) - chunks.map { |chunk| chunk.encode(@encoding.name) }.join + chunks.map { |chunk| chunk.encode(@encoding.name) }.join('') end # -- cgit v1.2.3