small fix
added an helper function to encode a list of items into a protocol-compliant array record