Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

TextEncoder and TextDecoder #926

Open
kvanbere opened this issue Apr 12, 2021 · 6 comments
Open

TextEncoder and TextDecoder #926

kvanbere opened this issue Apr 12, 2021 · 6 comments

Comments

@kvanbere
Copy link

kvanbere commented Apr 12, 2021

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

@zloirock
Copy link
Owner

It's not a part of ES, however, it's something that could be useful on each platform. I'll think about it.

@zloirock
Copy link
Owner

Adding support of legacy encodings is too expensive https://github.com/idiocc/text-decoding/blob/master/src/encoding-indexes.js.

@kvanbere
Copy link
Author

Only UTF8 is required by spec now. The best implementation that we've found is the lightweight one linked on MDN.

@aleen42
Copy link
Contributor

aleen42 commented Dec 30, 2021

@aleen42
Copy link
Contributor

aleen42 commented Jan 11, 2022

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

@zloirock
Copy link
Owner

zloirock commented Jan 11, 2022

@aleen42 you could take a look at the project with the same name from @romainmenke.

@zloirock zloirock changed the title Polyfill required for TextEncoder and TextDecoder TextEncoder and TextDecoder Jan 15, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

3 participants