code: public String toDecodeString(final int offset, int len, final Charset charset) {
          int start = offset;
          final int end = offset + len;
          boolean flag = false; //是否需要转义
          byte[] bs = content;
          for (int i = offset; i < end; i++) {
              if (content[i] == '+' || content[i] == '%') {
                  flag = true;
                  break;
              }
          }
          if (flag) {
              int index = 0;
              bs = new byte[len];
              for (int i = offset; i < end; i++) {
                  switch (content[i]) {
                      case '+':
                          bs[index] = ' ';
                          break;
                      case '%':
                          bs[index] = (byte) ((hexBit(content[++i]) * 16 + hexBit(content[++i])));
                          break;
                      default:
                          bs[index] = content[i];
                          break;
                  }
                  index++;
              }
              start = 0;
              len = index;
          }
          if (charset == null) return new String(Utility.decodeUTF8(bs, start, len));
          return new String(bs, start, len, charset);
      }
docs: 将指定的起始位置和长度按指定字符集并转义后转成字符串
  
  @param offset  起始位置
  @param len     长度
  @param charset 字符集
  
  @return 字符串