Uploaded image for project: 'JDK'
  1. JDK
  2. JDK-8259952

(jrtfs) Path::toUri encodes code points > 127 incorrectly

    XMLWordPrintable

    Details

    • Subcomponent:
    • CPU:
      generic
    • OS:
      generic

      Description

      A DESCRIPTION OF THE PROBLEM :
      Caused by the fix for JDK-8242258

      jdk.internal.jrtfs.JrtPath.toUri() does not properly encode code points > 127, respectively is not applying UTF-8 encoding.


      ---------- BEGIN SOURCE ----------
      FileSystem fileSystem = FileSystems.getFileSystem(URI.create("jrt:/"));
      String originalPath = "/modules/\u00E4";

      Path path = fileSystem.getPath(originalPath);
      URI uri = path.toUri();
      String reconverted = fileSystem.provider().getPath(uri).toString();
      System.out.println("Result: " + reconverted);
      System.out.println("Are paths equal: " + reconverted.equals(originalPath));
      ---------- END SOURCE ----------

        Attachments

          Issue Links

            Activity

              People

              Assignee:
              sundar Sundararajan Athijegannathan
              Reporter:
              pnarayanaswa Praveen Narayanaswamy
              Votes:
              0 Vote for this issue
              Watchers:
              3 Start watching this issue

                Dates

                Created:
                Updated: