code: public static String encodePathSaveEncodings(String segment) {
          String result = encodeFromArray(segment, pathEncoding, false);
          result = encodeNonCodes(result);
          return result;
      }
docs: Keep any valid encodings from string i.e. keep "%2D" but don't keep "%p"
  
  @param segment
  @return