private static String esc(Object x) {
		if (x == null) {
			return "null";
		}
		String s = x.toString();
		StringBuffer buf = new StringBuffer();
		for (char c : s.toCharArray()) {
			switch (c) {
			case '\t':
				buf.append("   ");
				break;
			case '\n':
			case '\r':
				buf.append(" ");
				break;
			default:
				if (Character.isISOControl(c)) {
					buf.append("#");
				} else {
					buf.append(c);
				}
			}
		}
		return buf.toString();
	}