Correctly encode URI