From 18a4d68b5cc0ea9d38270c43b9e2aae9507dfa46 Mon Sep 17 00:00:00 2001 From: Felix Lohmeier Date: Wed, 21 Aug 2019 16:47:21 +0200 Subject: [PATCH] support unicode chars in export to stdout --- google/refine/cli.py | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/google/refine/cli.py b/google/refine/cli.py index 9ae64cf..f3c44d2 100644 --- a/google/refine/cli.py +++ b/google/refine/cli.py @@ -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: @@ -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())