ensure inputs to URI#encode are strings, fixes #498

Noticed the issue report and thought I'd have a look. I'm pretty sure that converting `URI#encode`'s input to a string is the right fix, but if not let me know!

Will