Closed lo48576 closed 1 week ago
I think this could be ambiguity of the spec (or just my carelessness), but anyway I need more investigation.
I hope to maintain consistency between URIs (RFC 3986) and IRIs (RFC 3987), especially when they are written by US-ASCII characters only, so I think the normalization result of a://%99B/
should be identical between them.
That is, the implementation for both URIs and IRIs could be changed even though "US-ASCII only" condition is present only in RFC 3987.
My current opinion is, a://%99B/
should be normalized to itself, but not a://%99b/
.
Although host is case-insensitive, producers and normalizers should use lowercase for registered names and hexadecimal addresses for the sake of uniformity, while only using uppercase letters for percent-encodings.
From the phrase "should use lowercase for registered name", I think the case normalization to lower case should only apply to the decoded domain names (registered names). Case normalization on percent-encoded triplets is another layer than the normalization on "host" (registered name).
When an IRI uses components of the generic syntax, the component syntax equivalence rules always apply; namely, that the scheme and US-ASCII only host are case insensitive and therefore should be normalized to lowercase. (snip) Case equivalence for non-ASCII characters in IRI components that are IDNs are discussed in section 5.3.3.
So this "US-ASCII only (host)" should also be interpreted as US-ASCII only registered name, and non-US-ASCII-only hosts in percent-encoded ASCII representation should fall into the same category as "non-ASCII characters in IRI components that are IDNs", even if they are not encoded using IDN (RFC 3490).
Closing as not bug. If you think this is wrong or questionable, feel free to reopen or submit a new issue.
Reported at #36.
—— https://github.com/lo48576/iri-string/issues/36#issue-2241246314
—— https://github.com/lo48576/iri-string/issues/36#issuecomment-2053675842
—— https://github.com/lo48576/iri-string/issues/36#issuecomment-2053688909