diff --git a/lib/csv.rb b/lib/csv.rb index 89e1a2b..6ffb2c3 100644 --- a/lib/csv.rb +++ b/lib/csv.rb @@ -1456,7 +1456,7 @@ def generate(str=nil, **options) encoding = options[:encoding] # add a default empty String, if none was given if str - str = StringIO.new(str) + str = StringIO.new(+str) str.seek(0, IO::SEEK_END) str.set_encoding(encoding) if encoding else