code: public static String unescape(String s) {
          StringBuilder buf = new StringBuilder();
          int[] pos = new int[1];
          for (int i=0; i<s.length(); ) {
              char c = s.charAt(i++);
              if (c == '\\') {
                  pos[0] = i;
                  int e = unescapeAt(s, pos);
                  if (e < 0) {
                      throw new IllegalArgumentException("Invalid escape sequence " +
                              s.substring(i-1, Math.min(i+8, s.length())));
                  }
                  buf.appendCodePoint(e);
                  i = pos[0];
              } else {
                  buf.append(c);
              }
          }
          return buf.toString();
      }
docs: Convert all escapes in a given string using unescapeAt().
  @exception IllegalArgumentException if an invalid escape is
  seen.