summaryrefslogtreecommitdiff
path: root/bin/report/render/rml2pdf
diff options
context:
space:
mode:
authorP. Christeas <p_christ@hol.gr>2010-11-23 17:19:30 +0200
committerP. Christeas <p_christ@hol.gr>2010-11-23 17:19:30 +0200
commit6e893f1e9e607b3fcf392ae9cbbb4f7c696d4bd3 (patch)
tree90a3f5e542bd19534a2902650cd0783d1fc469ec /bin/report/render/rml2pdf
parent1a0a2535a2ff6052da73e7d042ffbbc852817ccd (diff)
rml2pdf: use ustr() instead of unicode()
When strings are 8-bit utf8-encoded, unicode will break with the usual: UnicodeDecodeError: 'ascii' codec can't decode byte 0xce in position .. message. ustr() will have better luck in those cases. Conflicts: bin/report/render/rml2pdf/utils.py bzr revid: p_christ@hol.gr-20101123151930-8r9q9gg7r902i2nv
Diffstat (limited to 'bin/report/render/rml2pdf')
-rw-r--r--bin/report/render/rml2pdf/utils.py5
1 files changed, 3 insertions, 2 deletions
diff --git a/bin/report/render/rml2pdf/utils.py b/bin/report/render/rml2pdf/utils.py
index e607aabeb20..6f8616da96d 100644
--- a/bin/report/render/rml2pdf/utils.py
+++ b/bin/report/render/rml2pdf/utils.py
@@ -45,6 +45,7 @@ import reportlab
import tools
from tools.safe_eval import safe_eval as eval
+from tools import ustr
_regex = re.compile('\[\[(.+?)\]\]')
@@ -131,11 +132,11 @@ def _process_text(self, txt):
if isinstance(txt, basestring):
result += str2xml(txt)
elif (txt is not None) and (txt is not False):
- result += unicode(txt)
+ result += ustr(txt)
return result
def text_get(node):
- return ''.join([unicode(n.text) for n in node])
+ return ''.join([ustr(n.text) for n in node])
units = [
(re.compile('^(-?[0-9\.]+)\s*in$'), reportlab.lib.units.inch),