diff --git a/ChangeLog b/ChangeLog index 7ce567b04..2cb5583f3 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,6 @@ +2007-07-30 Don Allingham + * src/DbLoader.py (DbLoader.do_import): catch unicode encoding errors + 2007-07-30 Don Allingham * src/GrampsDbUtils/_GedcomParse.py: assign inline note to the referencing object * src/GrampsDbUtils/_GedcomLex.py: fix UNKNOWN gender diff --git a/src/DbLoader.py b/src/DbLoader.py index 17a92c310..f6c3d5bd4 100644 --- a/src/DbLoader.py +++ b/src/DbLoader.py @@ -492,6 +492,12 @@ class DbLoader: importer(self.dbstate.db, filename, self.uistate.pulse_progressbar) dirname = os.path.dirname(filename) + os.path.sep Config.set(Config.RECENT_IMPORT_DIR, dirname) + except UnicodeError, msg: + QuestionDialog.ErrorDialog( + _("Could not import file: %s") % filename, + _("This GEDCOM file incorrectly identifies its character " + "set, so it cannot be accurately imported. Please fix the " + "encoding, and import again") + "\n\n %s" % msg) except Exception: _LOG.error("Failed to import database.", exc_info=True)