You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Do you think it would belong as a method of Encoding?
It doesn't exist as a method on Encoding at present, because I thought Rust programs would want to decode to UTF-8 and encode from UTF-16.
If there's a reason to believe that wishing to decode to UTF-16 in the non-streaming manner (with infallible allocation) has utility for Rust programs beyond one isolated case, then it would make sense to add UTF-16 variants of the non-streaming API to Rust, too. (Currently those variants are in C++ only.)
What's the context of your function? That is, should we expect it to represent a recurring use case or a one-time oddity?
I’ve used this in the Servo implementation of https://xhr.spec.whatwg.org/#json-response which takes a Vec<u8> that was earlier read from the network, and calls a SpiderMonkey function that takes const char16_t* chars, uint32_t len. So it is a rather isolated case.
(By the way we’re switching Servo to encoding_rs: servo/servo#19073)
I’ve just written this function:
Do you think it would belong as a method of
Encoding
?The text was updated successfully, but these errors were encountered: