Java tutorial
public class Main { public static void main(String[] args) { int cp1 = 0x0123, cp2 = 0x123fff; boolean b1 = Character.isValidCodePoint(cp1); boolean b2 = Character.isValidCodePoint(cp2); System.out.println(b1); System.out.println(b2); } }