Re: [whatwg/encoding] TextEncoder#encode - write to existing Uint8Array (#69)

I believe we could avoid exposing implementation details (while making the feature less useful) by specifying the the conversion fails immediately if the the number of available output space in bytes is not greater or equal to the the number of input UTF-16 code units times three plus one.

In other words if we didn't support incremental encode but required the worst-case (assuming an implementation that wants to see worst-case available space on a per input code point basis, hence the plus one) output space and always consumed the entire input string if it didn't throw right away.

-- 
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/69#issuecomment-349952258

Received on Thursday, 7 December 2017 12:24:33 UTC