Chakracore: Support TextEncoder&TextDecoder

Created on 24 Sep 2018  路  5Comments  路  Source: chakra-core/ChakraCore

TextEncoder and TextDecoder have been missing from IE/Edge forever.

This is a document of the api...
https://developer.mozilla.org/en-US/docs/Web/API/TextEncoder

Here is your status compared to other's status.
https://caniuse.com/#search=uint8array

I did just notice that there's a 'in development' note on 'can i use'
https://developer.microsoft.com/en-us/microsoft-edge/platform/status/encodingstandard

But actually going there and searching for 'TextEncoder' yields no results.

External

Most helpful comment

cc @liminzhu

This is unfortunately a browser API rather than an ECMAScript API, and as Bruce said, is out of scope for ChakraCore. From https://developer.microsoft.com/en-us/microsoft-edge/platform/status/encodingstandard, you can see that the Edge team is aware of the issue, and that link will be the place to check for any status updates on it.

All 5 comments

I want to add that this API is significant for WebAssembly<->JS boundary when dealing with strings

I've implemented TextEncoder/Decoder myself in miniSphere, albeit for UTF-8 only; it'd be great to have fully-featured versions available natively.

That said, these aren't part of ECMAScript so it might not make sense to have them in core.

cc @liminzhu

This is unfortunately a browser API rather than an ECMAScript API, and as Bruce said, is out of scope for ChakraCore. From https://developer.microsoft.com/en-us/microsoft-edge/platform/status/encodingstandard, you can see that the Edge team is aware of the issue, and that link will be the place to check for any status updates on it.

That being said, I do very much wish there was some kind of text encoding facility in the specification; it feels like a major shortcoming that we have DataView providing a standardized way to poke arbitrary integer and float values into an arraybuffer, but no standard way to do the same with strings. As it stands the Encoding API is a near-necessity if you want to process any kind of structured binary data in JS (which is why I implement it in miniSphere).

Thread has run its course.

Was this page helpful?
0 / 5 - 0 ratings