when I use " in fieldNames, it didn't convert " to "" as the value column did this convert.
like data:[ { name: 'maple"maple', age: 23 }] get csv data:"maple""maple",23,
but fieldNames: [ 'name"name', 'age' ] get csv title: "name\"name","age", not "name""name","age", which will occur excel format error.
PS:
lib/json2csv.js +157:
str += JSON.stringify(element).replace(/\"/g, params.quotes);
maybe str += JSON.stringify(element).replace(/\\"/g, params.doubleQuotes); ? cause " JSON.stringfiy get \\"
when I use
"
in fieldNames, it didn't convert"
to""
as the value column did this convert.like data:
[ { name: 'maple"maple', age: 23 }]
get csv data:"maple""maple",23
, but fieldNames:[ 'name"name', 'age' ]
get csv title:"name\"name","age"
, not"name""name","age"
, which will occur excel format error.PS: lib/json2csv.js +157:
str += JSON.stringify(element).replace(/\"/g, params.quotes);
maybestr += JSON.stringify(element).replace(/\\"/g, params.doubleQuotes);
? cause"
JSON.stringfiy get\\"