On 23/05/2020 01:15, Alex Menkov wrote:
size of utf8 string does not depend on sizeof(int).
Per RFC each symbol can be encoded by 1..4 byte(s).
Maybe Alan can explain this len+len/2+2 value.
I don't know without digging into the history. My only reason for
pointing it out is that it looked curious as I would have expected len*4
+ 1. The lack of parentheses will also force every reader to stop and
remind themselves of the precedence rules. I don't want to hold up
JDK-8244703, I was spotted it when checking for other usages of
utf8FromPlatform.
-Alan