if isinstance(buff, list):
      buff = ''.join([chr(c) for c in buff])