I believe that Java characters are 2 bytes; so the 0x10000 check doesn't make sense.

Also, it looks like you are explicitly escaping surrogate characters, like those for Chinese Ext-B:
```java
new String(new char[] { 0xD840, 0xDC00, 0xD840, 0xDC01, 0xD869, 0xDED5, 0xD869, 0xDED6 });
```
I do not think those need explicit escaping, and that "illegal" should just be C0 - {9,A,D}.