On Sun, 18 Jan 2026 08:13:40 GMT, Chen Liang <[email protected]> wrote:

> Question: Have you considered the handling of replacement characters? They 
> currently are counted into the returned length, but I wonder whether users 
> actually want to print those characters as-is.

That is a good point. As `getBytes(Charset)` is specified to replace 
malformed-input and unmappable-character sequences, and the proposed method is 
specified to return the equivalent of `getBytes(Charset).length` then the 
returned length has to include them.

-------------

PR Comment: https://git.openjdk.org/jdk/pull/28454#issuecomment-3765082490

Reply via email to