public static String decode(String input) {
		if (input == null) return null;
		if (input.indexOf("\\")!=-1) {
			int pos = input.indexOf("\\");
			StringBuffer output = new StringBuffer("");
			while (pos!=-1) {
				// is it dec or hex encoding ?
				if (input.charAt(pos+2) == 'x') {
					output.append(input.substring(0,pos));
					int code = Integer.parseInt(input.substring(pos+3,pos+7),16);
					output.append((char)code);
					input = input.substring(pos+7);
				} else {
					output.append(input.substring(0,pos));
					try {
						int code = Integer.parseInt(input.substring(pos+1,pos+4));
						output.append((char)code);
					} catch(Exception e) {
						System.out.println("POS="+pos+"S="+input.substring(pos+1,pos+4)+" E="+input);
						e.printStackTrace();
					}
					input = input.substring(pos+4);
				}
				pos = input.indexOf("\\");
			}
			output.append(input);
			String outs=output.toString();
			//System.out.println("decode out="+outs);
			return outs;
		} else {
			return input;
		}
	}