Commit ab436d40 authored by Kazuhiko Shiozaki's avatar Kazuhiko Shiozaki

skip 'unicode validitity' check for unicode instance (r28750 was wrong, sorry).


git-svn-id: https://svn.erp5.org/repos/public/erp5/trunk@28752 20353a03-c40f-0410-a6d1-a30d3c3de9de
parent b6b91430
...@@ -45,9 +45,7 @@ def convert(S, find=None): ...@@ -45,9 +45,7 @@ def convert(S, find=None):
### [\x00-\x1f] characters will be escaped to make a more ### [\x00-\x1f] characters will be escaped to make a more
### readable output. ### readable output.
try: try:
if isinstance(S, unicode): if not isinstance(S, unicode):
S = S.encode('utf8')
else:
S.decode('utf8') S.decode('utf8')
except UnicodeDecodeError: except UnicodeDecodeError:
new = ''.join([reprs3.get(x) for x in S]) new = ''.join([reprs3.get(x) for x in S])
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment