Skip to content

Commit

Permalink
support unicode chars in export to stdout
Browse files Browse the repository at this point in the history
  • Loading branch information
felixlohmeier committed Aug 21, 2019
1 parent 41c1e61 commit 18a4d68
Showing 1 changed file with 3 additions and 2 deletions.
5 changes: 3 additions & 2 deletions google/refine/cli.py
Original file line number Diff line number Diff line change
Expand Up @@ -168,7 +168,8 @@ def export(project_id, output_file=None, export_format=None):
if not export_format:
export_format = 'tsv'
if not output_file:
sys.stdout.write(project.export(export_format=export_format).read())
sys.stdout.write(project.export(
export_format=export_format).read().decode('UTF-8'))
else:
ext = os.path.splitext(output_file)[1][1:]
if ext:
Expand Down Expand Up @@ -264,7 +265,7 @@ def templating(project_id,
if not splitToFiles:
if not output_file:
sys.stdout.write(project.export_templating(
**templateconfig).read())
**templateconfig).read().decode('UTF-8'))
else:
with open(output_file, 'wb') as f:
f.write(project.export_templating(**templateconfig).read())
Expand Down

0 comments on commit 18a4d68

Please sign in to comment.