diff options
author | nobu <nobu@b2dd03c8-39d4-4d8f-98ff-823fe69b080e> | 2010-12-25 06:58:58 +0000 |
---|---|---|
committer | nobu <nobu@b2dd03c8-39d4-4d8f-98ff-823fe69b080e> | 2010-12-25 06:58:58 +0000 |
commit | d05217109fb5e909bbd7849bcc799b6404c7c8b0 (patch) | |
tree | 59c6e741e5c94660ea5860d745fffec33274121b /lib/csv.rb | |
parent | 47a1cd1291f1f52cc8d36cb533e0d653d128930a (diff) | |
download | ruby-d05217109fb5e909bbd7849bcc799b6404c7c8b0.tar.gz |
* 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
Diffstat (limited to 'lib/csv.rb')
-rw-r--r-- | lib/csv.rb | 14 |
1 files changed, 7 insertions, 7 deletions
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 # |