From 892f6b2c1675890e44f6af2d99a3711505dafc75 Mon Sep 17 00:00:00 2001 From: Peter Landgren Date: Mon, 14 Jul 2008 18:45:57 +0000 Subject: [PATCH] Fix of issue 2253 svn: r10860 --- src/GrampsDbUtils/_WriteGedcom.py | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/src/GrampsDbUtils/_WriteGedcom.py b/src/GrampsDbUtils/_WriteGedcom.py index fe18ae8ad..7706ca96a 100644 --- a/src/GrampsDbUtils/_WriteGedcom.py +++ b/src/GrampsDbUtils/_WriteGedcom.py @@ -257,8 +257,10 @@ def breakup(txt, limit): data = [] while len(txt) > limit: # look for non-space pair to break between + # Don't break within a UTF-8 byte sequence, i. e. first ch >127 idx = limit - while idx>0 and (txt[idx-1].isspace() or txt[idx].isspace()): + while (idx>0 and (txt[idx-1].isspace() or txt[idx].isspace() + or ord(txt[idx-1]) > 127)): idx -= 1 if idx == 0: #no words to break on, just break at limit anyway