process_uri: only encode if invalid
Merge pull request #1000 from taavo/better_process_url

process_uri: only encode if invalid