From: "Jörg W Mittag" Date: 2008-01-25T04:29:57+09:00 Subject: Re: Creating a canonicalized url Dan Cuddeford wrote: > Wow - thanks for the answer mate! There's also the Addressable Gem: . It's intended as a standards compliant replacement for the stdlib's URI library. Take a look into the test directory of that sucker: over 440 Unit Tests (actually, Object Examples) for a frickin' URI parser! (See: ) That guy is nuts! That code's gotta be as rock-solid as it gets. Oh, and back to the topic at hand: it has a normalize method built in: begin require 'rubygems' gem 'addressable' rescue LoadError; end require 'addressable/uri' uri = Addressable::URI.heuristic_parse('www.Ruby-Lang..ORG/ARSE/done/../../r e a r/./end/.#exit') uri.normalize! puts uri.display_uri # => http://www.ruby-lang..org/r%20e%20a%20r/end/#exit jwm