utility to encode uri params