encodeParameters

Internal helper function to encode raw parameters. Should not be used directly.