asafdav / ng-csv

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

Problem with BOM and Saving files in Excel #208

Open migarc1 opened 7 years ago

migarc1 commented 7 years ago

I need to add the attribute add-bom="true" because I am localizing my CSV File. The problem comes when I open the file, and try to save. The format will change, and if you try it to open again the file you will see a complete disorder.

Steps to reproduce:

  1. Generate a CSV file with at least 2 columns and with special characters (With add-bom attribute). <button type="button" ng-csv="getArray" csv-header="getHeader()" filename="example.csv" field-separator="," decimal-separator="." add-bom="true">
  2. Open the file in Excel
  3. Save the file with the button at the top of Excel (image), and close the file. (Don't save it again when Excel asks you)
  4. Open the file with Excel.

Before you save the file: image image

After you save the file: image image

Any help will be appreciated it.

Thanks.

WittTheRock commented 7 years ago

Same problem. (Win 7, Office 2013)