asafdav / ng-csv

Simple directive that turns arrays and objects into downloadable CSV files
MIT License
573 stars 215 forks source link

Special Characters issue #115

Open enniob opened 8 years ago

enniob commented 8 years ago

I found an issue that when you have a special character it gets replaced with some other characters.

For example I had data that had the Ø symbol and that got replaced with Ø6 mm.

Any ideas on how to solve this issue? It works fine when I display on the page, just when I call ng-csv to export the data I see this on the CSV file.

I noticed the same issue when I try to display Japanese text.

aliraza923 commented 8 years ago

Yes I am also facing the same problem with special chracters

jfgrang commented 8 years ago

Same problem with à è ç …

whiz11 commented 8 years ago

I am also having the issue with French special characters à è ç … What are the possible solutions?

grauds commented 8 years ago

Any update on this?

petecleary commented 8 years ago

I experience this issue when opening the generated CSV file directly in Excel however if I review the file in Notepad or a text editor then you can clearly see it has been exported correctly.

I am using the standard setting of UTF-8 as the encoding.

This was an issue with the BOM. When I set add-bom="true" the characters render correctly within Excel when opened directly.

pedro3900 commented 7 years ago

Hi, I am using:

<button class="" type="button" ng-csv="getData()" csv-header="getHeader()" add-bom="true" field-separator=";" filename="export.csv">Excel</button>

I still try:

<button class="" type="button" ng-csv="getData()" csv-header="getHeader()" add-bom="true" field-separator=";" charset="UTF-8" filename="export.csv">Excel</button>

but nothing work I get this text when open in excel: Raúl instead of Raúl

I am using v0.3.6 of ng-csv

janey0536 commented 7 years ago

The csv file looks good for Chinese characters after added add-bom="true" to the html file

pedro3900 commented 7 years ago

I added like in comment before but for me not work in excel program