Implement TextEncoder's encodeInto() |
||||||
Issue descriptionThis API allows for encoding a string into UTF-8 bytes using a preexisting target buffer. See https://github.com/whatwg/encoding/pull/166 for the standard change and https://github.com/web-platform-tests/wpt/pull/14505 for tests.
,
Jan 9
,
Jan 14
Not iOS (which does not use Blink)
,
Jan 14
Tagging with GFB to hopefully catch some attention. This will require an "Intent to Implement and Ship"; happy to help with that if an external contributor picks this up.
,
Jan 14
,
Jan 14
Interested in taking it, but can't yet guarantee an timeline. Will keep this thread updated though.
,
Jan 20
(3 days ago)
,
Today
(12 hours ago)
Following ricea@'s advice, my thoughts were to make a method similar to WTF::TextCodecUTF8::Encode that takes in a "capacity" in addition to the "length". Then we can make something like WTF::TextCodecUTF8::EncodeCommon that takes in the capacity, and calls U8_APPEND with it, instead of U8_APPEND_UNSAFE. However, this requires a TextCodecUTF8::Encode method with a new signature, and thus a change to WTF::TextCodec to support this IIUC. Thoughts on getting around this to avoid touching all of the TextCodec subclasses?
,
Today
(11 hours ago)
I think it would be acceptable to have virtual WTF::TextCodec::EncodeInto() { NOTREACHED(); }, overridden only in TextCodecUTF8. And then WTF::TextEncoding::EncodeInto() with a sufficient warning that only UTF8 supports it.
|
||||||
►
Sign in to add a comment |
||||||
Comment 1 by ricea@chromium.org
, Jan 9Status: Untriaged (was: Unconfirmed)