From 90e84c9a6dd264f7be3cfe31e98b1de3f815ebe0 Mon Sep 17 00:00:00 2001 From: Miroslav Stampar Date: Sun, 15 May 2011 21:43:38 +0000 Subject: [PATCH] removing xmlcharrefreplace error handler as it seems that it wasn't such a good idea at the end --- lib/core/common.py | 2 +- lib/core/convert.py | 4 ++-- 2 files changed, 3 insertions(+), 3 deletions(-) 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):