call the function sanitize_address with arguments addr and encoding, for every addr in return value of the getadresses function with tuple containing val as argument, join all the results into a string separated by ', ', substitute the result for val.
val = ', ' . join ( sanitize_address ( addr , encoding ) for addr in getaddresses ( ( val , ) ) )