properly escape carriage returns

This commit is contained in:
Andrew Martin 2016-07-05 10:01:04 -04:00
parent 3bfd8265bc
commit e17df21a2b
2 changed files with 9 additions and 9 deletions

View File

@ -54,7 +54,7 @@ encodeRow = id
. coerce . coerce
escape :: ByteString -> Escaped ByteString escape :: ByteString -> Escaped ByteString
escape t = case B.find (\c -> c == newline || c == comma || c == doubleQuote) t of escape t = case B.find (\c -> c == newline || c == cr || c == comma || c == doubleQuote) t of
Nothing -> Escaped t Nothing -> Escaped t
Just _ -> escapeAlways t Just _ -> escapeAlways t