On Wed, 29 Oct 2025 18:24:56 GMT, Liam Miller-Cushon <[email protected]> wrote:

> > A user can easily convert between one or the other length representation by 
> > multiplying/dividing by the right scalar
> 
> That is true of e.g. UTF-16 but not of UTF-8, since the encoding is variable 
> width and doing the conversion from bytes to characters is more expensive 
> there.

Sorry, I don't mean 'character' but 'unit', or whatever it's called (I don't 
think 'code point' is the right word either). For instance, when reading a 
UTF-8 string, the unit would be one byte, for UTF-16 it would be two, for 
UTF-32 four. So a user would just need to divide by the unit size, at least 
that's the idea.

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

PR Review Comment: https://git.openjdk.org/jdk/pull/28043#discussion_r2475835009

Reply via email to