1
0
Fork 0
mirror of https://github.com/ruby/ruby.git synced 2022-11-09 12:17:21 -05:00

[ruby/csv] Fix a bug that strip: true removes newlines

5540d35a30
This commit is contained in:
Kouhei Sutou 2019-04-23 05:54:44 +09:00 committed by Hiroshi SHIBATA
parent 8c0edbd79d
commit 198281a71d
2 changed files with 31 additions and 1 deletions

View file

@ -429,7 +429,7 @@ class CSV
end
@need_robust_parsing = true
elsif @strip
strip_values = " \t\r\n\f\v"
strip_values = " \t\f\v"
@escaped_strip = strip_values.encode(@encoding)
if @quote_character
@strip_value = Regexp.new("[#{strip_values}]+".encode(@encoding))