Exporting to CSV "SÃO" and "Há"

Exporting to CSV "SÃO" and "Há"

rockdrigo10rockdrigo10 Posts: 1Questions: 0Answers: 0

Im exporting my data to csv and when there is any special character such as "SÃO" and "Há" the result is
SÃO PAULO and Há
Can you please help me on this?

Thank you in advance

Replies

  • colincolin Posts: 15,142Questions: 1Answers: 2,586

    We're happy to take a look, but as per the forum rules, please link to a test case - a test case that replicates the issue will ensure you'll get a quick and accurate response. Information on how to create a test case (if you aren't able to link to the page you are working on) is available here.

    Cheers,

    Colin

  • rf1234rf1234 Posts: 2,806Questions: 85Answers: 406
    edited February 2020

    charset: 'UTF-8'
    should help
    Please take a look at this:
    https://datatables.net/reference/button/csv

    An example from my own coding:

    //custom button for cashflow csv generation
    $.fn.dataTable.ext.buttons.csvCashFlow = {
        extend: 'csv', fieldSeparator: ';', charset: 'UTF-8', bom: true,
                     filename: 'yourFilename',
       exportOptions: { ....
    
This discussion has been closed.