added collection handling to percent_encode