Java 不支持所有 utf-8 字符,例如
public static void main(String[] args){
Character cha = new Character('\uD841');
System.out.println(cha.compareTo(Character.MIN_VALUE));
String ts = "this is a test string";
StringBuilder sb = new StringBuilder();
sb.append(ts);
sb.append(cha);
ts = sb.toString();
for(int i =0;i<ts.length();i++){
System.out.println(Character.isLetter(ts.charAt(i)));
}
}
它将打印“这是一个测试字符串?” 如何确保不支持哪个字符?