Fix CSV/XLS exports with numbers containings unicode U+202f (narrow no-break space)

Fix CSV/XLS exports with numbers containings unicode U+202f (narrow no-break space)

simplerezosimplerezo Posts: 4Questions: 2Answers: 0

Link to test case: http://live.datatables.net/toweyoto/2/edit
Description of problem:
When datas contains U+202f (for an example, because generated by NumberFormat INTL PHP extension...), CSV export and Excel exports are not usables.
Sorry about the live test I have not been able to display exports buttons...

Answers

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

    I added the buttons in here and it appears to be behaving as expected. Could you look at that, please, and see if it helps. If it's still not working for you, please can you update my example, or link to your page, so that we can see the problem.

    Cheers,

    Colin

  • simplerezosimplerezo Posts: 4Questions: 2Answers: 0
    edited November 2021

    Ok thanks for adding the button :)

    I have added CSV export and the issue is present, also in PDF export (but not in XLS): http://live.datatables.net/toweyoto/4/edit

  • kthorngrenkthorngren Posts: 21,330Questions: 26Answers: 4,951

    A CSV file is a text file and AFAIK there is no unicode support. I'm not familiar with the PDF specification but a quick search yields a lot of discussion on Stack Overflow of how to use unicode characters. Doesn't sound easy. The PDFMake docs might have details about unicode support.

    You can use Orthogonal data to convert the unicode character to a space or something else you want to display in the CSV.

    Others may be able to help with the PDF but the place to start is by looking at the docs to see if PDFMake supports unicode and when is needed to format the output text.

    Kevin

Sign In or Register to comment.