edlanglois · GitHub

For a commodity AB.C (entered as "AB.C" in the journal), the following CSV balance output is produced:

hledger -f test.journal balance --output-format=csv:

"account","balance"
"Assets:ABC","\"\"AB.C\"\" 1"
"Assets:Cash","$-1"
"total","$-1, \"\"AB.C\"\" 1"

\"\"AB.C\"\" is too much escaping. Quotes are escaped in CSV by entering them twice: "" so ""AB.C"" is the properly escaped string. The extra \s can actually cause the " to be un-escaped from the perspective of a CSV reader such that they are interpreted as ending a string.

I think this is a regression, but I might be mis-remembering.

More details:
hledger version: 1.21

test file:

2021-01-01 Test
    Assets:ABC   "AB.C" 1
    Assets:Cash       -$1

Read the original on github.com ↗