OmbraDiFenice/table2csv

Get compatible with Office Excel

Closed this issue · 3 comments

element.setAttribute('href', 'data:text/plain;charset=utf-8,' + encodeURIComponent(text));

Use code below instead, so as to get compatible with Office Excel.

    element.setAttribute('href', 'data:text/plain;charset=utf-8,\ufeff' + encodeURIComponent(text));

I just tried that but I don't see any difference. I can open the csv with my MS Excel in both cases the same way.
Which version of Excel are you referring to?

this fixes broken "umlaut" for me in german strings (for example, München) :
https://en.wikipedia.org/wiki/Umlaut_(linguistics).

Thank you @blendi-93, that I could verify myself :)
I have added the BOM bytes to the metadata. Published on npm as v1.1.2