Made uri format escape special characters before parsing

Ruby's URI.parse does not accept non-latin characters, and will raise an
error on any uri that is not completely in the latin alphabet. This is a
problem for example, in japanese uris. I believe that the correct way to
handle this in ruby is to escape the string before parsing it.
Added file encoding to help older versions of ruby read non-latin
characters in the test files
Merge pull request #114 from iainbeeston/nonlatin_uris

Handle non-latin uris