Properly encode uri components