encode URI prior to parsing.