intertwingly

It’s just data

URI Equivalence


In researching how Atom and the FeedValidator should handle URI equivalence, I took a look at how language environments with built in URI classes implement equality methods.

testuri.java produces:

 http://example.com/          http://example.com           false
 HTTP://example.com/          http://example.com/          true
 http://example.com/          http://example.com:/         true
 http://example.com/          http://example.com:80/       false
 http://example.com/          http://Example.com/          true
 http://example.com/~smith/   http://example.com/%7Esmith/ false
 http://example.com/~smith/   http://example.com/%7esmith/ false
 http://example.com/%7Esmith/ http://example.com/%7esmith/ true
 http://example.com/%C3%87    http://example.com/C%CC%A7   false

testuri.cs produces:

 http://example.com/          http://example.com           True
 HTTP://example.com/          http://example.com/          True
 http://example.com/          http://example.com:/         True
 http://example.com/          http://example.com:80/       True
 http://example.com/          http://Example.com/          True
 http://example.com/~smith/   http://example.com/%7Esmith/ True
 http://example.com/~smith/   http://example.com/%7esmith/ True
 http://example.com/%7Esmith/ http://example.com/%7esmith/ True
 http://example.com/%C3%87    http://example.com/C%CC%A7   True

Update: testuri.pl produces:

 http://example.com/          http://example.com           1
 HTTP://example.com/          http://example.com/          1
 http://example.com/          http://example.com:/         1
 http://example.com/          http://example.com:80/       1
 http://example.com/          http://Example.com/          1
 http://example.com/~smith/   http://example.com/%7Esmith/ 1
 http://example.com/~smith/   http://example.com/%7esmith/ 1
 http://example.com/%7Esmith/ http://example.com/%7esmith/ 1
 http://example.com/%C3%87    http://example.com/C%CC%A7   0