URL encode the segment value