Encode and decode url components