Skip to content

Commit

Permalink
Revert "Simplify constructing chars"
Browse files Browse the repository at this point in the history
This reverts commit d0d878c.
  • Loading branch information
daniellansun committed Jan 14, 2025
1 parent d0d878c commit de5ff81
Showing 1 changed file with 2 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -59,7 +59,7 @@ public static String replaceHexEscapes(String text) {
return replaceAll(text, HEX_ESCAPES_PATTERN, m -> {
final String _0 = m.group(0), _1 = m.group(1), _2 = m.group(2);
if (isLengthOdd(_1)) return _0;
return _1 + ((char) Integer.parseInt(_2, 16));
return _1 + new String(Character.toChars(Integer.parseInt(_2, 16)));
});
}

Expand All @@ -68,7 +68,7 @@ public static String replaceOctalEscapes(String text) {
return replaceAll(text, OCTAL_ESCAPES_PATTERN, m -> {
final String _0 = m.group(0), _1 = m.group(1), _2 = m.group(2);
if (isLengthOdd(_1)) return _0;
return _1 + ((char) Integer.parseInt(_2, 8));
return _1 + new String(Character.toChars(Integer.parseInt(_2, 8)));
});
}

Expand Down

0 comments on commit de5ff81

Please sign in to comment.