0

I have been reading quite some posts including this one

Javascript export CSV encoding utf-8 issue

I know lots mentioned it's because of microsoft excel that using something like this should work

https://superuser.com/questions/280603/how-to-set-character-encoding-when-opening-excel

I have tried on ubuntu (which didn't even have any issue), on windows10, which I have to use the second posts to import, on mac which has the biggest problem because mac does not import, does not read the unicode at all.

Is there anyway I can do it in coding while exporting to enforce excel to open with utf-8? or some other workaround I might be able to try?

Thanks in advance for any help and suggestions.

Tsuna
  • 1,728
  • 3
  • 19
  • 35
  • The direct path for users is to use Excel's text file import wizard. Then they can answer all the umpteen metadata questions that need to come with CSV files. (Or, just export to an open-standard file format that carries all the metadata, such as .xlsx.) – Tom Blodget Mar 25 '19 at 16:31
  • Possible duplicate of [Is it possible to force Excel recognize UTF-8 CSV files automatically?](https://stackoverflow.com/questions/6002256/is-it-possible-to-force-excel-recognize-utf-8-csv-files-automatically) – Tom Blodget Mar 25 '19 at 16:33
  • @TomBlodget I did see that post too and tried. Somehow that `mac's excel` does not work too. Could this be the problem with the machine / software itself instead of the coding? – Tsuna Mar 25 '19 at 16:38

1 Answers1

0

Many Windows applications, including Excel, assume the localized ANSI encoding (Windows-1252 on US Windows) when opening a file, unless the file starts with byte-order-mark (BOM) code point. While UTF-8 doesn't need a BOM, a UTF-8-encoded BOM at the start of a file clues Excel that the file is UTF-8. The byte sequence is EF BB BF and the equivalent Unicode code point is U+FEFF.

Mark Tolonen
  • 132,868
  • 21
  • 152
  • 208