Export csv issue with other language characters utf8

Export csv issue with other language characters utf8

Jonvil123Jonvil123 Posts: 34Questions: 0Answers: 0
edited December 2018 in Free community support

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.

Replies

  • colincolin Posts: 15,240Questions: 1Answers: 2,599

    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

  • Jonvil123Jonvil123 Posts: 34Questions: 0Answers: 0

    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

  • Jonvil123Jonvil123 Posts: 34Questions: 0Answers: 0
    edited December 2018

    Hi @colin

    Do you have solution if using the csvhtml5. thanks ☺

  • kthorngrenkthorngren Posts: 21,303Questions: 26Answers: 4,947

    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

  • Jonvil123Jonvil123 Posts: 34Questions: 0Answers: 0
    edited December 2018

    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

  • kthorngrenkthorngren Posts: 21,303Questions: 26Answers: 4,947

    When I open the CSV file in a text editor it looks correct:

    "Chloé Cox","Technical Author","San Francisco","66","2009/01/12","$4,800"
    

    Kevin

  • Jonvil123Jonvil123 Posts: 34Questions: 0Answers: 0

    But when i open it in sheets its look like this. Thanks kevin

  • kthorngrenkthorngren Posts: 21,303Questions: 26Answers: 4,947

    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

This discussion has been closed.