BrianHicks / elm-csv

Decode CSV in the most boring way possible.

Home Page:https://package.elm-lang.org/packages/BrianHicks/elm-csv/latest/

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Wrong `AdditionalCharactersAfterClosingQuote` with quoted string inside cell

myrho opened this issue · comments

The following test would fail:

test "quoted single values 2" <|
    \_ ->
        "x"
            ++ config.rowSeparator
            ++ "1 \"a\" 2"
            |> parse { fieldSeparator = config.fieldSeparator }
            |> Expect.equal (Ok [ [ "x", "1 \"a\" 2" ] ])

It yields

    Err (AdditionalCharactersAfterClosingQuote 2)
    ╷
    │ Expect.equal
    ╵
    Ok [["x","1 \"a\" 2"]]

Unfortunately I'm not very into the parser code in order to be able to fix this.

What is producing that CSV? The proper encoding would be:

x,"1 ""a"" 2"

Alright, fixed that in the csv generating part. Thanks for the hint!