While talking to the Uri class, answering another question, I found something that seemed strange to me:
Consider these two Uris:
var u1 = new Uri("http://ab:33/abc%2fdef/c?d=f"); var u2 = new Uri("foobar://ab:33/abc%2fdef/c?d=f");
They differ only in their scheme. All other elements of the identifiers provided are the same.
So why, when I Segments property of these Uri instances, I see the following output for u1 :
/
abc /
def /
c
... but another conclusion for u2 ?
/
abc% 2fdef /
c
Why is parsing behavior different for different schemas?
source share