Thanks to visit codestin.com
Credit goes to github.com

Skip to content

Conversation

ArtskydJ
Copy link
Contributor

@ArtskydJ ArtskydJ commented Oct 9, 2020

Summary

I saw a few issues (#995, #1473) regarding CSV output encoding, and I wondered if it was working.

Test plan

So I wrote a test... Turns out it is working.

@alubbe alubbe merged commit a487181 into exceljs:master Oct 9, 2020
@pputnam-NAVEX
Copy link

Was the new Excel document opened and checked after it was written to? I can successfully encode the file as UTF-8, check in console fine, but when Excel opens the document characters including the Hebrew text used in the test are gibberish. Notepad++ correctly displays it and if I use Notepad++ to encode it to UTF-8-BOM I can re-open the spreadsheet and it will display correctly.

@pputnam-NAVEX
Copy link

Adding:
worksheet.getCell('A1').value = "\ufeff" + worksheet.getCell('A1').value;

Right before the writeFile works, also if this same file is then read using readFile \ufeff is undetectable - unsure if this is something worth adding as BOM isn't recommended but limitations in viewability of UTF-8 characters when opening actual Excel files for non-technical or data visualization may be helpful.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants