Skip to content

Commit

Permalink
Merge pull request #280 from cokeBeer/master
Browse files Browse the repository at this point in the history
fix csv encoding problem
  • Loading branch information
shmilylty authored Oct 8, 2022
2 parents 714b412 + 7162e40 commit 8b19841
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 0 deletions.
2 changes: 2 additions & 0 deletions common/utils.py
Original file line number Diff line number Diff line change
Expand Up @@ -330,6 +330,8 @@ def export_all_results(path, name, fmt, datas):
row_list.append(Record(keys, values))
rows = RecordCollection(iter(row_list))
content = rows.export(fmt)
if fmt == 'csv':
content = '\ufeff' + content
save_to_file(path, content)


Expand Down
2 changes: 2 additions & 0 deletions export.py
Original file line number Diff line number Diff line change
Expand Up @@ -60,6 +60,8 @@ def do_export(fmt, path, rows, show, domain, target):
if show:
print(rows.dataset)
data = rows.export(fmt)
if fmt == 'csv':
data = '\ufeff' + data
utils.save_to_file(path, data)
logger.log('ALERT', f'The subdomain result for {domain}: {path}')
data = rows.as_dict()
Expand Down

0 comments on commit 8b19841

Please sign in to comment.