简体   繁体   中英

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.

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.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM