code: @Deprecated
      public static String encodeRFC2396(String url) {
          try {
              return new URI(null,url,null).toASCIIString();
          } catch (URISyntaxException e) {
              LOGGER.log(Level.WARNING, "Failed to encode {0}", url);    // could this ever happen?
              return url;
          }
      }
docs: Encodes the URL by RFC 2396.
  
  I thought there's another spec that refers to UTF-8 as the encoding,
  but don't remember it right now.
  
  @since 1.204
  @deprecated since 2008-05-13. This method is broken (see ISSUE#1666). It should probably
  be removed but I'm not sure if it is considered part of the public API
  that needs to be maintained for backwards compatibility.
  Use {@link #encode(String)} instead.