From ffa5b6db61f99fafed3547fbf4cac1798247a5ec Mon Sep 17 00:00:00 2001 From: prculley Date: Sat, 24 Sep 2016 15:47:03 -0500 Subject: [PATCH] Fix bug 9717, XML import with env language other than utf8, has bad progress meter --- gramps/plugins/importer/importxml.py | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/gramps/plugins/importer/importxml.py b/gramps/plugins/importer/importxml.py index 6882afbe7..fc245261b 100644 --- a/gramps/plugins/importer/importxml.py +++ b/gramps/plugins/importer/importxml.py @@ -361,9 +361,10 @@ class LineParser: # will not work properly, going immediately to # 100%. # It should work correctly from version 3.3. - ofile = io.TextIOWrapper(gzip.open(filename, "rb")) + ofile = io.TextIOWrapper(gzip.open(filename, "rb"), + encoding='utf8', errors='replace') else: - ofile = open(filename, "r") + ofile = open(filename, "r", encoding='utf8', errors='replace') for line in ofile: self.count += 1