Uploaded image for project: 'Hippo CMS'
  1. Hippo CMS
  2. CMS-7047

URL Encoding with Charset.defaultCharset() doesn't really make sense

    XMLWordPrintable

Details

    • Bug
    • Status: Closed
    • Low
    • Resolution: Fixed
    • 2.24.01
    • 2.26.03
    • None
    • None

    Description

      RestProxyServicePlugin.java has the following:

      // Make sure that it is URL encoded correctly, except for the '/' and ':' characters
      normalizedPingServiceUri = URLEncoder.encode(pingServiceUri, Charset.defaultCharset().name())
      .replaceAll("%2F", "/").replaceAll("%3A", ":");

      Note that it uses 'Charset.defaultCharset().name() instead of one of the standard charsets such as ISO-8859-1 or UTF-8.
      In my local env, Charset.defaultCharset().name() returns 'MacRoman'.
      Even if this doesn't make a problem for now, I think it should have used either 'UTF-8' or 'ISO-8859-1' or removed #encode() call (the replaceAll() calls doesn't look neat).

      [1] http://docs.oracle.com/javase/6/docs/api/java/nio/charset/Charset.html

      Attachments

        Issue Links

          Activity

            People

              Unassigned Unassigned
              wko Woonsan Ko (Inactive)
              Votes:
              0 Vote for this issue
              Watchers:
              1 Start watching this issue

              Dates

                Created:
                Updated:
                Resolved: