Tsuna
Tsuna

Reputation: 2196

Javascript export CSV encoding utf-8 and using excel to open issue

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.

Upvotes: 0

Views: 1044

Answers (1)

Mark Tolonen
Mark Tolonen

Reputation: 177901

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.

Upvotes: 0

Related Questions