Skip to content

Commit 6a9fca0

Browse files
committed
Force ASCII when decoding numbers from unicode-escape
1 parent 4efc828 commit 6a9fca0

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

graalpython/com.oracle.graal.python/src/com/oracle/graal/python/charset/PythonUnicodeEscapeCharsetDecoder.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -83,7 +83,7 @@ static CoderResult decodeHexUnicodeEscape(ByteBuffer source, CharBuffer target,
8383
source.get(numbuf, 0, count);
8484
int codePoint;
8585
try {
86-
codePoint = Integer.parseInt(new String(numbuf, 0, count), 16);
86+
codePoint = Integer.parseInt(new String(numbuf, 0, count, StandardCharsets.US_ASCII), 16);
8787
} catch (NumberFormatException e) {
8888
int pos = source.position();
8989
source.position(initialPosition);

0 commit comments

Comments
 (0)