Open kvanbere opened 3 years ago
It's not a part of ES, however, it's something that could be useful on each platform. I'll think about it.
Adding support of legacy encodings is too expensive https://github.com/idiocc/text-decoding/blob/master/src/encoding-indexes.js.
Only UTF8 is required by spec now. The best implementation that we've found is the lightweight one linked on MDN.
There are some alternatives:
I have created https://github.com/aleen42/core-web to try to eliminate different behaviours of Web APIs through different browsers and is there any suggestion or lists of collected polyfill? @zloirock
@aleen42 you could take a look at the project with the same name from @romainmenke.
There is already good browser support for these, but Node.js does not have these at all, so testing code that uses them is an issue if you're using jest w/ babel or something like that.
Having a polyfill for these that just 'works out of the box' would be great. There's a very good polyfill at the page below.
https://developer.mozilla.org/en-US/docs/Web/API/TextEncoder