1,Character.Subset 和Character.UnicodeBlock , 其中Character.Subset类用于描述Unicode编码的一个子集,而Character.UnicodeBlock类中包含了Unicode 2.0编码的字符块。
2,
static int | codePointAt(CharSequence seq, int index) |
public static final char MIN_HIGH_SURROGATE = '/uD800';
public static final char MIN_LOW_SURROGATE = '/uDC00';
public static final int MIN_SUPPLEMENTARY_CODE_POINT = 0x010000;
public static int toCodePoint(char high, char low) {
return ((high - MIN_HIGH_SURROGATE) << 10)
+ (low - MIN_LOW_SURROGATE) + MIN_SUPPLEMENTARY_CODE_POINT;
}
public static int codePointAt(CharSequence seq, int index) {
char c1 = seq.charAt(index++);
if (isHighSurrogate(c1)) {
if (index < seq.length()) {
char c2 = seq.charAt(index);
if (isLowSurrogate(c2)) {
return toCodePoint(c1, c2);
}
}
}
return c1;
}