Skip to content

Commit

Permalink
Fix UNICODE_VALID_CODEPOINT_P
Browse files Browse the repository at this point in the history
  • Loading branch information
djoooooe committed Jul 15, 2022
1 parent d87794d commit 0860897
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion src/org/jcodings/util/Macros.java
Original file line number Diff line number Diff line change
Expand Up @@ -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));
}

Expand Down

0 comments on commit 0860897

Please # to comment.