Open mrherickz opened 11 months ago
Same as windows-874
:
TypeError: Unsupported encoding label "windows-874"
code: "ERR_INVALID_ARG_TYPE"
at ***/src/index.ts:243:21
This also applies to euc-jp
:
46 | const decoder = new TextDecoder('euc-jp');
^
TypeError: Unsupported encoding label "euc-jp"
code: "ERR_INVALID_ARG_TYPE"
FWIW, according to this MDN page a User Agent must support all the encodings listed on that page to be considered as implementing the Encoding API Spec. Maybe the Bun documentation should be updated to show that TextEncoder and TextDecoder are not fully implemented until all the encodings are supported?
Unfortunately, my code requires that euc-jp
be supported, so until Bun fully implements TextDecoder, I have to use Deno instead.
Same with windows-1251
let decoder = new TextDecoder("windows-1251")
goes to
TypeError: Unsupported encoding label "windows-1251"
code: "ERR_INVALID_ARG_TYPE"
yeah we have only implemented utf16-le and utf8 so far
13214 will add support for utf-16be
Just confirmed via canary build! Thank you so much!
Reopening cause windows-1251
encoding is still missing, sorry.
What version of Bun is running?
1.0.4+aec0d35f9b90083b93299859822ac67f3389a6d1
What platform is your computer?
Darwin 22.3.0 x86_64 i386
What steps can reproduce the bug?
Try decoding a utf-16be buffer.
What is the expected behavior?
It should be able to decode utf-16be buffers
What do you see instead?
Throws
TypeError: Unsupported encoding label "utf-16be"
Additional information
No response