coston / json-to-csv-export

A function to easily generate csv downloads of your json data. ✨
https://json-to-csv-export.coston.io
MIT License
83 stars 24 forks source link

Issue in export Hebrew text - add UTF-8 BOM to CSV export #38

Closed Royb10 closed 2 years ago

Royb10 commented 2 years ago

Thanks for the great tool! I found an issue - The CSV file should be saved as UTF-8 otherwise Excel and other encoding-sensitive applications may show gibberish instead of Hebrew characters.

You can see the Title column: utf-8 export issue

If I open the file with Notepad or import it to excel using Excel Data tools - all good. I think the solution is to add UTF-8 BOM to CSV export, maybe this could help: https://stackoverflow.com/questions/17879198/adding-utf-8-bom-to-string-blob/27975629#27975629

coston commented 2 years ago

Hey @Royb10, thank you for sharing this issue. The default encoding for blob is UTF-8, so we'd only need to add the BOM marker. Seems fine to me. Is there downside to doing this? (i'm wondering why it's not the default)

Royb10 commented 2 years ago

Hi @coston, thanks for the quick reply! From what I've checked and researched, I don't see any downside. really interesting why it's not the default...

coston commented 2 years ago

Hey @Royb10, BOM support is available in v2.1.0

Royb10 commented 2 years ago

Works perfectly, thanks much!