From d0c255cb53ad57fca267e801806a63f7c6e57f39 Mon Sep 17 00:00:00 2001 From: Alex Roitman Date: Thu, 5 Feb 2004 19:37:58 +0000 Subject: [PATCH] * src/plugins/Merge.py (gen_key,name_compare): Fall back to not using soundex if the charset can't be latin-1 encoded. svn: r2778 --- ChangeLog | 4 ++++ src/plugins/Merge.py | 14 +++++++++++--- 2 files changed, 15 insertions(+), 3 deletions(-) diff --git a/ChangeLog b/ChangeLog index 1ecc7134c..f40d15b95 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,7 @@ +2004-02-05 Alex Roitman + * src/plugins/Merge.py (gen_key,name_compare): + Fall back to not using soundex if the charset can't be latin-1 encoded. + 2004-02-05 Michel Guitel * doc/gramps-manual/fr/cmdline.xml: Update. * doc/gramps-manual/fr/filtref.xml: Update. diff --git a/src/plugins/Merge.py b/src/plugins/Merge.py index 3e1c45754..3b406c937 100644 --- a/src/plugins/Merge.py +++ b/src/plugins/Merge.py @@ -1,7 +1,7 @@ # # Gramps - a GTK+/GNOME based genealogy program # -# Copyright (C) 2000 Donald N. Allingham +# Copyright (C) 2000-2004 Donald N. Allingham # # This program is free software; you can redistribute it and/or modify # it under the terms of the GNU General Public License as published by @@ -18,6 +18,8 @@ # Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA # +# $Id$ + "Database Processing/Merge people" #------------------------------------------------------------------------- @@ -292,13 +294,19 @@ class Merge: def gen_key(self,val): if self.use_soundex: - return soundex.soundex(val) + try: + return soundex.soundex(val) + except UnicodeEncodeError: + return val else: return val def name_compare(self,s1,s2): if self.use_soundex: - return soundex.compare(s1,s2) + try: + return soundex.compare(s1,s2) + except UnicodeEncodeError: + return s1 == s2 else: return s1 == s2