JDK-8259952 : (jrtfs) Path::toUri encodes code points > 127 incorrectly
  • Type: Bug
  • Component: tools
  • Sub-Component: jlink
  • Affected Version: 16
  • Priority: P4
  • Status: Open
  • Resolution: Unresolved
  • OS: generic
  • CPU: generic
  • Submitted: 2021-01-18
  • Updated: 2021-02-10
The Version table provides details related to the release that this issue/RFE will be addressed.

Unresolved : Release in which this issue/RFE will be addressed.
Resolved: Release in which this issue/RFE has been resolved.
Fixed : Release in which this issue/RFE has been fixed. The release containing this fix may be available for download as an Early Access Release or a General Availability Release.

To download the current JDK release, click here.
Other
tbdUnresolved
Related Reports
Relates :  
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 ----------
Comments
We need to improve the round trip conversions for input like this.
19-01-2021

This is a followup to the bug https://bugs.openjdk.java.net/browse/JDK-8242258.
19-01-2021

More information can be found at: https://bugs.openjdk.java.net/browse/JDK-8242258?focusedCommentId=14393860&page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel#comment-14393860
18-01-2021