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
As it is right now CsvProvider doesn't even allow you to configure the escape character to be anything other than the default \. This poses a problem when exporting JSON in CSV because it has the tendency to break the necessary CSV quote escapes due to JSON needing it's own escapes for quotes inside strings.
Example JSON:
{"prop":"value with \"escaped double quotes\""}
Expected result:
"{""prop"":""value with \""escaped double quotes\""""}"
Actual result:
"{""prop"":""value with \"escaped double quotes\"""}"
The actual result breaks CSV columns, making the CSV data pretty much garbage (notice the JSON escaped quotes missing the CSV escaping in the actual result).
Due to the way that fputcsv works, escaping the escape character (eg. \\) doesn't change anything. Allowing for escape to be an empty string removes this limitation altogether and some specific usecases could benefit from escape character for CSV being configurable in the profile itself.
Bugfix:
Use empty string as the escape character passed to Writer.
Feature:
Allow escape character to be configured per profile, defaulting to empty string if none is present.
The text was updated successfully, but these errors were encountered:
As it is right now CsvProvider doesn't even allow you to configure the escape character to be anything other than the default
\
. This poses a problem when exporting JSON in CSV because it has the tendency to break the necessary CSV quote escapes due to JSON needing it's own escapes for quotes inside strings.Example JSON:
Expected result:
Actual result:
The actual result breaks CSV columns, making the CSV data pretty much garbage (notice the JSON escaped quotes missing the CSV escaping in the actual result).
Due to the way that
fputcsv
works, escaping the escape character (eg.\\
) doesn't change anything. Allowing for escape to be an empty string removes this limitation altogether and some specific usecases could benefit from escape character for CSV being configurable in the profile itself.Bugfix:
Use empty string as the escape character passed to Writer.
Feature:
Allow escape character to be configured per profile, defaulting to empty string if none is present.
The text was updated successfully, but these errors were encountered: