docs: def dump_csv(data: List[dict], fieldnames: Sequence[str], with_header: bool = False, crlf: bool = False,
               tsv: bool = False) -> str:
      """
      :param data:
      :param fieldnames:
      :param with_header:
      :param crlf:
      :param tsv:
      :return: unicode
      """
  
      def force_str(v):
          # XXX: Double quotation behaves strangely... so replace (why?)
          return dump_json(v).replace('"', "'") if isinstance(v, (dict, list)) else v
  
      with io.StringIO() as sio:
          dialect = get_dialect_name(crlf, tsv)
          writer = csv.DictWriter(sio, fieldnames=fieldnames, dialect=dialect, extrasaction='ignore')
          if with_header:
              writer.writeheader()
          for x in data:
              writer.writerow({k: force_str(v) for k, v in x.items()})
          sio.seek(0)
          return sio.read()