Lets understand the following terms first.
- Code Point : A character which is in the range of
- Supplemental Characters : Characters whose value is greater than
- Basic Multilingual Plan (BMP) : Characters whose value is between
The change from
characters caused a problem to Java since supplemental characters can not be stored in regular character whose size is
. To avoid this Java uses two chars to represent a single supplemental character. The first char is called the high surrogate
where as the second character is called the low surrogate
To primarily help with this problem a new method called
is provided. This method returns
, it can store these two chars with out any problem. Java also provided overloaded forms that operate on int. Some sample methods are:
static boolean isDigit(int codePoint)
static boolean isLetter(int codePoint)
static int toLowerCase(int codePoint)
Listed below are more methods which help in handling 32-bit Unicode Code Points.