paragraph.py: fix encoding issue in _splitWord (transplant from 3774 with changes) py33
authorrobin
Sat, 07 Dec 2013 18:04:12 +0000
branchpy33
changeset 3930 950841932d03
parent 3929 b8175c55af71
child 3931 ceee76b69e7c
paragraph.py: fix encoding issue in _splitWord (transplant from 3774 with changes)
src/reportlab/platypus/paragraph.py
--- a/src/reportlab/platypus/paragraph.py	Sat Dec 07 17:41:59 2013 +0000
+++ b/src/reportlab/platypus/paragraph.py	Sat Dec 07 18:04:12 2013 +0000
@@ -543,7 +543,9 @@
     R = []
     maxlineno = len(maxWidths)-1
     lineWidth = 0
-    wordText = ''
+    wordText = u''
+    if isBytes(w):
+        w = w.decode('utf8')
     for c in w:
         cw = stringWidth(c,fontName,fontSize,encoding)
         newLineWidth = lineWidth+cw