Export csv issue with other language characters utf8
Export csv issue with other language characters utf8
Jonvil123
Posts: 34Questions: 0Answers: 0
Hi
Good day. Hope you're all great.
Guys please help me. Have problem exporting csv with french accents. I have tried adding below:
extend: 'csvHtml5',
charset: 'utf-8',
bom: true,
Still doesnt work. see below exported file result and the table. thanks hope you can help me. really appreciate.
This discussion has been closed.
Replies
Hi @Jonvil123 ,
If you look at this example here, you'll see "Chloé Cox" is being exported as expected. It suggests the characters are wrong in your dataset, maybe there's some garbage in there. Feel free to modify my example to demonstrate the problem,
Cheers,
Colin
Hi colin
Still not work. I change the exporthtml5 to csvhtml. it was exported but still the "Chloé Cox" hasnt exported as it is. it has special chars. pls help. thanks colin
Hi @colin
Do you have solution if using the csvhtml5. thanks ☺
As Colin mentioned his test case with special characters works as expected. Please update his test case or create your own with your data to replicate the problem. This way it can be diagnosed.
Kevin
Hi @kthorngren
Thanks for the reply.
You can check sample from colin
Just change the excelhtml5 to csvhtml5. you can see that the value for cloe is not the same as it is. Thanks a lot ☺
here
http://live.datatables.net/bazeyuna/1/edit
When I open the CSV file in a text editor it looks correct:
Kevin
But when i open it in sheets its look like this. Thanks kevin
To import using Excel for example you can use the import wizard and change the file origin to UTF-8 which results in this:
Haven't tried it but I suppose this example can be modified to format the CSV output how you want:
https://datatables.net/extensions/buttons/examples/html5/outputFormat-function.html
Kevin