private static String unquotedCharLiteral(char c) {
        // http://java.sun.com/docs/books/jls/second_edition/html/lexical.doc.html#101089
        switch (c) {
            case '\b':
                return "\\b";
            case '\t':
                return "\\t";
            case '\n':
                return "\\n";
            case '\f':
                return "\\f";
            case '\r':
                return "\\r";
            case '\"':
                return "\\\"";
            case '\'':
                return "\\\'";
            case '\\':
                return "\\\\";
            default:
                if (c >= ' ' && c <= '~') {
                    return "" + c;
                } else {
                    String hex = Integer.toHexString(c);
                    switch (hex.length()) {
                        case 1:
                            return "\\u000" + hex;
                        case 2:
                            return "\\u00" + hex;
                        case 3:
                            return "\\u0" + hex;
                        default:
                            return "\\u" + hex;
                    }
                }
        }
    }
@see org.xml.sax.ContentHandler#skippedEntity(java.lang.String)
src/nu/validator/xml/SaxCompiler.java