You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
This repository has been archived by the owner on Sep 28, 2018. It is now read-only.
I'm working on a tool to generate a CSV export of some data in a browser, and unfortunately, the encoding situation is a bit of a mess. TL/DR, it seems that the best outcome results in a tab separated, utf-16-le encoded file. [1][2]
I'm interested in using this package not as a polyfill, but by directly loading it when I need to perform that encoding. Would you be open to a PR that moved the core encoding functionality into a standalone module, and implementing the polyfill as a consumer of that standalone library?
As long as the polyfill doesn't require any build steps or pulling in additional libraries (e.g. some "require" variant), then I'd consider it. You may want to sketch out your idea first to discuss in more detail.
Also, I should mention that you can implement UTF-16 encoding far more efficiently than the polyfill does:
// assume bytes = Uint8Array of byte.// also assumes array buffers are little endian - may need to byte-swap otherwisevarstring=newUint16Array(bytes.buffer).map(cp=>String.fromChar(cp)).join('');
Sign up for freeto subscribe to this conversation on GitHub.
Already have an account?
Sign in.
I'm working on a tool to generate a CSV export of some data in a browser, and unfortunately, the encoding situation is a bit of a mess. TL/DR, it seems that the best outcome results in a tab separated, utf-16-le encoded file. [1][2]
I'm interested in using this package not as a polyfill, but by directly loading it when I need to perform that encoding. Would you be open to a PR that moved the core encoding functionality into a standalone module, and implementing the polyfill as a consumer of that standalone library?
[1] https://donatstudios.com/CSV-An-Encoding-Nightmare
[2] http://terminaln00b.ghost.io/excel-just-save-it-as-a-csv-noooooooo/
The text was updated successfully, but these errors were encountered: