Fix HtmlUtils unescape for supplementary chars

See gh-35477

Signed-off-by: potato <65760583+juntae6942@users.noreply.github.com>
This commit is contained in:
potato
2025-11-17 15:07:42 +01:00
committed by Brian Clozel
parent 3b6be3d4d3
commit 47de8b05e6
2 changed files with 46 additions and 1 deletions
@@ -124,7 +124,10 @@ class HtmlCharacterEntityDecoder {
int value = (!isHexNumberedReference ?
Integer.parseInt(getReferenceSubstring(2)) :
Integer.parseInt(getReferenceSubstring(3), 16));
this.decodedMessage.append((char) value);
if (value > Character.MAX_CODE_POINT) {
return false;
}
this.decodedMessage.appendCodePoint(value);
return true;
}
catch (NumberFormatException ex) {