diff --git a/lib/core/common.py b/lib/core/common.py index 8d51f8ee8..187b4980f 100644 --- a/lib/core/common.py +++ b/lib/core/common.py @@ -1798,7 +1798,7 @@ def getUnicode(value, encoding=None, system=False): if isinstance(value, unicode): return value elif isinstance(value, basestring): - return unicode(value, encoding or UNICODE_ENCODING, errors="xmlcharrefreplace") + return unicode(value, encoding or UNICODE_ENCODING, errors="replace") else: return unicode(value) # encoding ignored for non-basestring instances else: diff --git a/lib/core/convert.py b/lib/core/convert.py index 1422d330b..6746a1fa6 100644 --- a/lib/core/convert.py +++ b/lib/core/convert.py @@ -85,7 +85,7 @@ def urldecode(value, encoding=None): result = urllib.unquote_plus(value) if isinstance(result, str): - result = unicode(result, encoding or UNICODE_ENCODING, errors="xmlcharrefreplace") + result = unicode(result, encoding or UNICODE_ENCODING, errors="replace") return result @@ -137,7 +137,7 @@ def unicodeencode(value, encoding=None): try: retVal = value.encode(encoding or UNICODE_ENCODING) except UnicodeEncodeError: - retVal = value.encode(UNICODE_ENCODING, "xmlcharrefreplace") + retVal = value.encode(UNICODE_ENCODING, "replace") return retVal def utf8encode(value):