From 26fed05e642058e66f1227184f5c88bb9be0484e Mon Sep 17 00:00:00 2001 From: Peter Landgren Date: Tue, 8 Sep 2009 07:35:10 +0000 Subject: [PATCH] String must be unicode for truncation to work for non ascii characters. svn: r13169 --- src/ScratchPad.py | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/src/ScratchPad.py b/src/ScratchPad.py index fc4502db3..be430da65 100644 --- a/src/ScratchPad.py +++ b/src/ScratchPad.py @@ -323,6 +323,8 @@ class ScratchPadNote(ScratchPadWrapper): value = self._db.get_note_from_handle(handle) self._title = value.get_gramps_id() + #String must be unicode for truncation to work for non ascii characters + note = unicode(note) note = value.get().replace('\n', ' ') if len(note) > 80: self._value = note[:80]+"..." @@ -494,6 +496,8 @@ class ScratchPadSourceRef(ScratchPadGrampsTypeWrapper): text = "" if len(srctxtlist) > 0: text = " ".join(srctxtlist[0].get().split()) + #String must be unicode for truncation to work for non ascii characters + text = unicode(text) if len(text) > 60: text = text[:60]+"..." self._value = _("Volume/Page: %(pag)s -- %(sourcetext)s") % {