workflow/svg: correct encoding for textwrap (fix #2544)

This commit is contained in:
Thomas NOËL 2013-03-07 17:22:53 +01:00
parent e79b4e1f87
commit f1c480f744
1 changed files with 4 additions and 1 deletions

View File

@ -133,7 +133,10 @@ def graphviz(workflow, url_prefix='', select=None, svg=True,
label += ' %s %s' % (_('by'), roles)
else:
label = item.render_as_line()
label = textwrap.fill(label.replace('"', '\\"'), 20)
label = label.replace('"', '\\"')
label = label.decode('utf8')
label = textwrap.fill(label, 20, break_long_words=False)
label = label.encode('utf8')
label = label.replace('\n', '\\n')
print >>out, '[label="%s"' % label,
if select == '%s-%s' % (i, item.id):