In Java, Character.isSupplementaryCodePoint(codePoint) returns true when the code point is a supplementary one: from 0x10000 to 0x10FFFF. Such characters do not fit in one char and are stored as a surrogate pair.
Most emoji, many historic scripts, mathematical alphanumeric symbols, and rare CJK ideographs are supplementary. If your code assumes "one char = one character", these are the characters that break it.
A static method of java.lang.Character (Java 5+): call it on the class, as in Character.isSupplementaryCodePoint(...); you do not need a Character object. No import is needed, because java.lang is always available.
Syntax
Pass an int code point.
Java
Character.isSupplementaryCodePoint(0xFFFF); // false, still in the BMP
Character.isSupplementaryCodePoint(0x10000); // true, the first one
Character.isSupplementaryCodePoint(0x1F600); // true, an emoji
Character.isSupplementaryCodePoint(0x110000); // false, not a code point
One overload, isSupplementaryCodePoint(int codePoint), available since Java 5. The constant Character.MIN_SUPPLEMENTARY_CODE_POINT holds 0x10000.
Library declarations
Java
// java.lang.Character (since Java 5)
public static boolean isSupplementaryCodePoint(int codePoint)
public static final int MIN_SUPPLEMENTARY_CODE_POINT = 0x010000;
Parameters
Parameter
Description
codePoint (int)
The code point to check.
Return Value
Return Value
Description
true
0x10000 to 0x10FFFF inclusive.
false
BMP code points, negative numbers, and values above 0x10FFFF.