code: private static void appendEncoded(StringBuilder sb, String value) {
          for (char ch : value.toCharArray()) {
              if (isUnreserved(ch)) sb.append(ch);
              else appendEscapedByte(sb, (byte) ch);
          }
      }
docs: TODO use UTF-8 before escaping, this only works for ascii (which is all we currently need)