Add encoding to uri_spec for Ruby 1.9 compatibility.