From 0860897b9d01284e5e749d7b76a26c180bd6ed60 Mon Sep 17 00:00:00 2001 From: Josef Haider Date: Fri, 15 Jul 2022 13:32:59 +0200 Subject: [PATCH] Fix UNICODE_VALID_CODEPOINT_P --- src/org/jcodings/util/Macros.java | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/org/jcodings/util/Macros.java b/src/org/jcodings/util/Macros.java index c8ed091..829c208 100644 --- a/src/org/jcodings/util/Macros.java +++ b/src/org/jcodings/util/Macros.java @@ -48,7 +48,7 @@ public static int CONSTRUCT_MBCLEN_CHARFOUND(int n) { // UNICODE_VALID_CODEPOINT_P public static boolean UNICODE_VALID_CODEPOINT_P(int c) { - return ((c) <= 0x10ffff) && + return (Integer.compareUnsigned(c, 0x10ffff) <= 0) && !((c) < 0x10000 && UTF16_IS_SURROGATE((c) >> 8)); }