summaryrefslogtreecommitdiff
path: root/lib/csv.rb
diff options
context:
space:
mode:
Diffstat (limited to 'lib/csv.rb')
-rw-r--r--lib/csv.rb2
1 files changed, 1 insertions, 1 deletions
diff --git a/lib/csv.rb b/lib/csv.rb
index fe153153be3..b6d91211461 100644
--- a/lib/csv.rb
+++ b/lib/csv.rb
@@ -1655,7 +1655,7 @@ class CSV
if @io.is_a?(StringIO) and
output.encoding != raw_encoding and
(compatible_encoding = Encoding.compatible?(@io.string, output))
- @io = StringIO.new(@io.string.force_encoding(compatible_encoding))
+ @io.set_encoding(compatible_encoding)
@io.seek(0, IO::SEEK_END)
end
@io << output