System.out.println("Text:" + text + " Character:" + c);
    public static String parseSymbols(String text) {        boolean asciicontrol = false;        StringBuffer buf = new StringBuffer();        int marker = 0;        char c;        for (int i = 0; i < text.length(); i++) {            c = text.charAt(i);            if (c == '%') {                if (marker == 2) {                    // a sequence of %%%%%065 means '%A'                    buf.append('%');                    marker = 0;                } else {                    marker++;                }            } else if (c == '^') {                asciicontrol = true;            } else if (asciicontrol) {                // ASCII-control sign map                if (Character.isWhitespace(c)) {                    buf.append('^');                } else {                    // filtering acsii controls here                }                asciicontrol = false;            } else if (c == '\\') {                //test for unicode                if ((text.length() > (i + 6)) && (text.charAt(i + 1) == 'U') &&                        (text.charAt(i + 2) == '+')) {                    String part = text.substring(i + 3, i + 7);                    int unicode = Integer.parseInt(part, 16);                    buf.append((char) unicode);                    i += 6;                } else {                    buf.append('\\');                }            } else {                if (marker == 0) {                    buf.append(c);                } else if (marker == 1) {                    // the control % self                    buf.append('%');                    marker = 0;                } else if (marker == 2) {                    switch (c) {                    case 'd':                        buf.append('\u00B0');                        break;                    case 'c':                        buf.append('\u2205');                        break;                    case 'p':                        buf.append('\u00B1');                        break;                    default:                        if (Character.isDigit(c) && ((i + 2) < text.length())) {                            String code = "" + c + text.charAt(i + 1) +                                text.charAt(i + 2);                            try {                                c = (char) Integer.parseInt(code);                                buf.append(c);                                i += 2;                            } catch (NumberFormatException e) {                                System.out.println("Text:" + text +                                    " Character:" + c);                                // TODO sometimes there are only one                                // digit                                buf.append('?');                                i++;                            }                        } else {                            //a style control write back                            buf.append("%%");                            buf.append(c);                        }                    }                    marker = 0;                } else if (marker == 3) {                    buf.append('%');                    marker = 0;                }            }        }        if ((marker == 1) || (marker == 3)) {            buf.append('%');        }        return buf.toString();    }