While poking around with the Uri class answering another question, I found something that seems strange to me:
Consider these two Uris:
var u1 = new Uri("http://a.b:33/abc%2fdef/c?d=f");
var u2 = new Uri("foobar://a.b:33/abc%2fdef/c?d=f");
They differ only by their scheme. All other elements of the supplied identifiers are the same.
So, why, when I dump the Segments
property of these Uri instances, do I see the following output for u1
:
/ abc/ def/ c
...but a different output for u2
?
/ abc%2fdef/ c
Why is the the parsing behaviour different for different schemes?