* src/ReadGedcom.py: coerce the name into a unicode value - if the wrong character

encoding is indicated in the file, the screen display can get corrupted due to keys
that aren't unicode values


svn: r4557
This commit is contained in:
Don Allingham 2005-05-12 00:28:36 +00:00
parent eba70ed463
commit baf80601af
2 changed files with 10 additions and 7 deletions

View File

@ -1,4 +1,7 @@
2005-05-11 Don Allingham <don@gramps-project.org> 2005-05-11 Don Allingham <don@gramps-project.org>
* src/ReadGedcom.py: coerce the name into a unicode value - if the wrong character
encoding is indicated in the file, the screen display can get corrupted due to keys
that aren't unicode values
* src/dates/Date_de.py: first pass at a German date handler * src/dates/Date_de.py: first pass at a German date handler
2005-05-11 Martin Hawlisch <Martin.Hawlisch@gmx.de> 2005-05-11 Martin Hawlisch <Martin.Hawlisch@gmx.de>

View File

@ -933,11 +933,11 @@ class GedcomParser:
except: except:
names = (matches[2],"","","","") names = (matches[2],"","","","")
if names[0]: if names[0]:
name.set_first_name(names[0].strip()) name.set_first_name(unicode(names[0].strip()))
if names[2]: if names[2]:
name.set_surname(names[2].strip()) name.set_surname(unicode(names[2].strip()))
if names[4]: if names[4]:
name.set_suffix(names[4].strip()) name.set_suffix(unicode(names[4].strip()))
if name_cnt == 0: if name_cnt == 0:
self.person.set_primary_name(name) self.person.set_primary_name(name)
else: else:
@ -1648,11 +1648,11 @@ class GedcomParser:
elif matches[1] == "SPFX": elif matches[1] == "SPFX":
name.set_surname_prefix(matches[2]) name.set_surname_prefix(matches[2])
elif matches[1] == "SURN": elif matches[1] == "SURN":
name.set_surname(matches[2]) name.set_surname(unicode(matches[2]))
elif matches[1] == "_MARNM": elif matches[1] == "_MARNM":
self.parse_marnm(self.person,matches[2].strip()) self.parse_marnm(unicode(self.person,matches[2].strip()))
elif matches[1] == "TITL": elif matches[1] == "TITL":
name.set_suffix(matches[2]) name.set_suffix(unicode(matches[2]))
elif matches[1] == "NSFX": elif matches[1] == "NSFX":
if name.get_suffix() == "": if name.get_suffix() == "":
name.set_suffix(matches[2]) name.set_suffix(matches[2])
@ -1665,7 +1665,7 @@ class GedcomParser:
self.person.set_nick_name(matches[2]) self.person.set_nick_name(matches[2])
else: else:
name = RelLib.Name() name = RelLib.Name()
name.set_surname(lname[-1]) name.set_surname(unicode(lname[-1]))
name.set_first_name(' '.join(lname[0:l-1])) name.set_first_name(' '.join(lname[0:l-1]))
self.person.add_alternate_name(name) self.person.add_alternate_name(name)
elif matches[1] == "SOUR": elif matches[1] == "SOUR":