[whatwg/encoding] Identity encoding? (#138)

I realize this is probably a wrong place to ask this, but are/were there any plans to add some kind of "identity" encoding? Such that for each x in range `[0, 255]`, these would be true:
```javascript
new TextDecoder(SOMETHING).decode(new Uint8Array([x])).charCodeAt(0) === x
new TextEncoder(SOMETHING).encode(String.fromCharCode(x))[0] === x
```

I am asking because I'd normally expect the `iso-8859-1` encoding to work this way, but it maps to `windows-1252` even though they're not the same...
I've checked all available encodings but found none that has above properties.

This could greatly simplify conversion between `Uint8Array` and Base64 using `atob`/`btoa` (of course a `base64` encoding would simplify it even more...)

-- 
You are receiving this because you are subscribed to this thread.
Reply to this email directly or view it on GitHub:
https://github.com/whatwg/encoding/issues/138

Received on Thursday, 26 April 2018 15:33:25 UTC