-
Notifications
You must be signed in to change notification settings - Fork 5.3k
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
feat(op_crates/web): Add all single byte encodings to TextDecoder #6178
Conversation
@AliBasicCoder Thanks for the patch. I haven't looked at this in detail yet - but this needs tests before it can be landed. |
Just to point out, browsers only support encoding UTF-8. https://encoding.spec.whatwg.org/#interface-textencoder so this would be a significant variation from the spec. |
@kitsonk This is about decoding though. Encoding should stay utf-8 only to be spec compliant, but decoder can have many encodings (Chrome has many encodings for decoding, but only utf-8 for encoding). |
@kitsonk i just added for decoding and didn't touch TextEncoder at all |
🤦 I can't read. Sorry folks. |
i have just added all the labels for the encodings |
@AliBasicCoder I'm all for this but we need tests... Maybe you can take some tests from here: https://github.com/web-platform-tests/wpt/blob/master/encoding/single-byte-decoder.html |
so, i found some issuses and fixed theme and tested it with the following then made this script import { TextDecoder } from "./cli/js/web/text_encoding.ts";
// @ts-ignore
window.TextDecoder = TextDecoder; then bundled it via then converted it to the browser via then downloaded https://github.com/web-platform-tests/wpt and commneted the then included the bundle via a script tag and this is the result: |
@AliBasicCoder We need those tests to run continuously so they don't get broken in the future. |
so, where to add theme |
@AliBasicCoder How about in Tests can be run with |
tests are added now |
@AliBasicCoder We are missing a CLA from you. It's preventing this PR from going green. I believe you've signed it before - it's the same terms - but we updated it changing my personal name to an entity Deno Land Inc. |
i signed the CLA |
@AliBasicCoder I'm interested in landing this PR, could you rebase it and move the logic to |
bddcfc2
to
dda69cd
Compare
done |
the problem is
|
b5d5c2a
to
0b22429
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM. Huge thanks to @AliBasicCoder and sorry it took so long to land
@AliBasicCoder any plan to add utf-16le? Now emscripten's js code use utf-16le for decoding. I want to run wasm compiled by emscripten, and utf-16le is a problem. if you can implement it, and it will be very greatful to run emscripten wasm on Deno. thanks.
|
see #8108 |
Agreed |
i added this ecodings
NOTES: