You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
The JNI support for Java Strings added in cl/321475293 did not handle Unicode
characters correctly, passing the number of bytes requested to a method that
actually wanted the number of chars. Switching to this broke reading strings
from Java if they have any non-ASCII Unicode characters in them.
Additionally, the old routines cl/321475293 was supposed to replace treat the
bytes coming into/out of Java as modified UTF-8, even though our product works
with standard UTF-8. This meant we had latent bugs around handling of null
bytes and characters beyond the basic multilingual plane.
This CL fixes both issues, by converting Strings to UTF-8 bytes using methods
on String itself. This avoids dealing in modified UTF-8 or the bug prone JNI
methods like `GetStringUTFRegion`.
PiperOrigin-RevId: 348050717
0 commit comments