RFR: JDK-8244703: "platform encoding not initialized" exceptions with debugger, JNI
Alan Bateman
Alan.Bateman at oracle.com
Sat May 23 08:54:39 UTC 2020
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
More information about the serviceability-dev
mailing list