diff --git a/gramps/plugins/db/bsddb/read.py b/gramps/plugins/db/bsddb/read.py index ca2cacca0..61d5b43f4 100644 --- a/gramps/plugins/db/bsddb/read.py +++ b/gramps/plugins/db/bsddb/read.py @@ -917,8 +917,11 @@ class DbBsddbRead(DbReadBase, Callback): Return the default grouping name for a surname. Return type is a unicode object """ - key = surname.encode('utf-8') - return self.name_group.get(key, surname) + group = self.name_group.get(surname.encode('utf-8')) + if group is not None: + return group.decode('utf-8') + else: + return surname def get_name_group_keys(self): """ diff --git a/gramps/plugins/db/bsddb/write.py b/gramps/plugins/db/bsddb/write.py index 5bdcd5455..fa56dd960 100644 --- a/gramps/plugins/db/bsddb/write.py +++ b/gramps/plugins/db/bsddb/write.py @@ -1640,7 +1640,7 @@ class DbBsddb(DbBsddbRead, DbWriteBase, UpdateCallback): if data is not None: txn.delete(sname) if group is not None: - txn.put(sname, group) + txn.put(sname, group.encode('utf-8')) if group is None: grouppar = '' else: