Skip to content

Accept \r without quote if row separator doesn't include \r #60

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Open
kou opened this issue Dec 24, 2018 · 1 comment · May be fixed by #346
Open

Accept \r without quote if row separator doesn't include \r #60

kou opened this issue Dec 24, 2018 · 1 comment · May be fixed by #346

Comments

@kou
Copy link
Member

kou commented Dec 24, 2018

This may work:

@@ -360,12 +320,14 @@ class CSV
       if @liberal_parsing
         @unquoted_value = Regexp.new("[^".encode(@encoding) +
                                      escaped_column_separator +
-                                     "\r\n]+".encode(@encoding))
+                                     escaped_row_separator +
+                                     "]+".encode(@encoding))
       else
         @unquoted_value = Regexp.new("[^".encode(@encoding) +
                                      escaped_quote_character +
                                      escaped_column_separator +
-                                     "\r\n]+".encode(@encoding))
+                                     escaped_row_separator +
+                                     "]+".encode(@encoding))
       end
       @cr_or_lf = Regexp.new("[\r\n]".encode(@encoding))
       @not_line_end = Regexp.new("[^\r\n]+".encode(@encoding))
@kou
Copy link
Member Author

kou commented Dec 24, 2018

This may be difficult because row separator may be two or more characters such as \r\n.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging a pull request may close this issue.

1 participant