2006-11-24 Don Allingham <don@gramps-project.org>

* src/GrampsDb/_WriteXML.py: handle unicode decoding errors
	* src/plugins/NarrativeWeb.py: handle unicode decoding errors
	* src/plugins/AncestorReport.py: bring into conformance with the spec.



svn: r7689
This commit is contained in:
Don Allingham
2006-11-25 01:02:26 +00:00
parent 9b8533c3e9
commit 8e87a284aa
4 changed files with 172 additions and 31 deletions

View File

@ -413,6 +413,11 @@ class BasePage:
return
format = noteobj.get_format()
text = noteobj.get()
try:
text = unicode(text)
except UnicodeDecodeError:
text = unicode(str(text),errors='replace')
if text:
of.write('<div id="narrative">\n')
of.write('<h4>%s</h4>\n' % _('Narrative'))
@ -1531,8 +1536,9 @@ class IndividualPage(BasePage):
of.write('<td class="field">')
self.source_link(of,source.handle,title,source.gramps_id,True)
tmp = []
confidence = Utils.confidence.get(sref.confidence, _('Unknown'))
for (label,data) in [(_('Page'),sref.page),
(_('Confidence'),Utils.confidence[sref.confidence]),
(_('Confidence'),confidence),
(_('Text'),sref.text)]:
if data:
tmp.append("%s: %s" % (label,data))