diff options
| author | YSA (Openerp) <ysa@tinyerp.com> | 2011-01-20 11:07:33 +0530 |
|---|---|---|
| committer | YSA (Openerp) <ysa@tinyerp.com> | 2011-01-20 11:07:33 +0530 |
| commit | f030d1219e2411e4b557f960d603fca1fcbb012e (patch) | |
| tree | f7cc7e772563e2a1fecc9713987b569af35bd0d4 /bin/report/interface.py | |
| parent | 1b287f9b7b7ffc6719a7839753597341cc75d7fb (diff) | |
| parent | 10a6bb350c2f054e262ee4649855185795e611d5 (diff) | |
Merge with trunk-server
bzr revid: ysa@tinyerp.com-20110120053733-ws7mfcfw15p0iyy1
Diffstat (limited to 'bin/report/interface.py')
| -rw-r--r-- | bin/report/interface.py | 14 |
1 files changed, 5 insertions, 9 deletions
diff --git a/bin/report/interface.py b/bin/report/interface.py index c6ceae4d0e4..36f54b31fdb 100644 --- a/bin/report/interface.py +++ b/bin/report/interface.py @@ -33,16 +33,12 @@ import render import urllib # -# encode a value to a string in utf8 and converts XML entities +# coerce any type to a unicode string (to preserve non-ascii characters) +# and escape XML entities # -def toxml(val): - if isinstance(val, str): - str_utf8 = val - elif isinstance(val, unicode): - str_utf8 = tools.ustr(val) - else: - str_utf8 = str(val) - return str_utf8.replace('&', '&').replace('<','<').replace('>','>') +def toxml(value): + unicode_value = tools.ustr(value) + return unicode_value.replace('&', '&').replace('<','<').replace('>','>') class report_int(netsvc.Service): def __init__(self, name, audience='*'): |
