From 54ab2820c3b4d7a20243ce3ed3ba9aa08102b342 Mon Sep 17 00:00:00 2001 From: prculley Date: Mon, 5 Feb 2018 11:41:12 -0600 Subject: [PATCH] Fix Export View to CSV when Unicode characters are present Fixes #10404 --- gramps/gen/utils/docgen/csvtab.py | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/gramps/gen/utils/docgen/csvtab.py b/gramps/gen/utils/docgen/csvtab.py index a9d6bfe51..01822ebf4 100644 --- a/gramps/gen/utils/docgen/csvtab.py +++ b/gramps/gen/utils/docgen/csvtab.py @@ -31,6 +31,7 @@ import csv # #------------------------------------------------------------------------- from .tabbeddoc import * +from ...constfunc import win class CSVTab(TabbedDoc): @@ -48,7 +49,8 @@ class CSVTab(TabbedDoc): else: self.filename = filename - self.f = open(self.filename, "w") + self.f = open(self.filename, "w", + encoding='utf_8_sig' if win() else 'utf_8') self.writer = csv.writer(self.f) def close(self):