Difference in encoding semantics of URI returned by File.toURI and Path.toUri representing the same file

Sebastian Stenzel sebastian.stenzel at gmail.com
Wed Jan 13 18:45:29 UTC 2021

> On 13. Jan 2021, at 17:50, Daniel Fuchs <daniel.fuchs at oracle.com> wrote:
> [...]
> It's not clear to me whether NFC should be applied - or what would be
> the consequences of applying NFC there (or not).

While I can't answer this question, it may be worth mentioning RFC 3987 which might not be directly applicable but also deals with the representation of non-ASCII data in URIs.

In section 3 it explicitly asks for NFC-normalization _before_ applying percent-encoding. I can't tell what's the rationale behind this decision but possibly the behaviour of URI.toASCIIString() is in the spirit of these rules.

More information about the core-libs-dev mailing list