You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
CSV fields made only of double quotes are read back wrong #1058
A CSV field that holds nothing but double quotes is read back wrong. " comes back as an empty string and "" comes back as ". MiniExcel writes these values correctly ("""" and """"""), so its own export does not round-trip.
CsvReader.Split unescapes "" before it strips the enclosing quotes:
For """" the replace pairs the enclosing quote with the escaped one and leaves "", and the regex then strips both. Fields with any other character in them are fine, e.g. "a", a", "a round-trip.
varexporter=MiniExcelV2.Exporters.GetCsvExporter();varimporter=MiniExcelV2.Importers.GetCsvImporter();exporter.Export("a.csv",new[]{new{v="\""},new{v="\"\""}});varrows=importer.Query("a.csv",hasHeaderRow:true).ToList();// rows[0].v == "" and rows[1].v == "\""
Expected Behavior
rows[0].v == "\"" and rows[1].v == "\"\"", the values that were written.
Actual Behavior
"" and "\"".
Workarounds
Pass a custom CsvConfiguration.SplitFn.
Environment (please fill the following information):
Activity
Strip enclosing quotes before unescaping CSV fields