protected String printable(String s) { if(s == null) return null; StringBuffer buf = new StringBuffer(); for(int i = 0; i < s.length(); ++i) { buf.append(printable(s.charAt(i)));
protected String printable(char ch) { if(ch == '\n') { return "\\n"; } else if(ch == '\r') { return "\\r"; } else if(ch == '\t') { return "\\t"; } if(ch > 127 || ch < 32) { StringBuffer buf = new StringBuffer("\\u"); String hex = Integer.toHexString((int)ch); for (int i = 0; i < 4-hex.length(); i++) { buf.append('0'); } buf.append(hex); return buf.toString();
    protected String printable(String s) {        if(s == null) return null;        StringBuffer buf = new StringBuffer();        for(int i = 0; i < s.length(); ++i) {            buf.append(printable(s.charAt(i)));        }        s = buf.toString();        return s;    }