alhudz opened a new pull request, #1726:
URL: https://github.com/apache/commons-lang/pull/1726

   Repro: escape any supplementary code point with the base `UnicodeEscaper`, 
e.g. `UnicodeEscaper.above(0x7f).translate(new 
String(Character.toChars(0x10437)))`.
   Expected: `𐐷`.
   Actual: `၃7`, a single `\u` carrying five hex digits, which no `\u` reader 
decodes back to U+10437 (`UnicodeUnescaper` reads `၃` then a literal `7`).
   Cause: `toUtf16Escape` returns `"\\u" + hex(codePoint)`, but a code point 
above `0xffff` does not fit the four hex digits a `\u` escape holds, so the 
surrogate split is never applied.
   Fix: emit the surrogate-pair form `\uXXXX\uXXXX` for supplementary code 
points, matching the method name and the behaviour `JavaUnicodeEscaper` already 
has. BMP code points are untouched.


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: [email protected]

For queries about this service, please contact Infrastructure at:
[email protected]

Reply via email to