From 6bc5f44b2018bfe2cda4791c35c16ed2668586e7 Mon Sep 17 00:00:00 2001 From: Miroslav Stampar Date: Tue, 25 Sep 2012 15:09:07 +0200 Subject: [PATCH] Minor just in case update for an Issue #195 (safer behavior on forced charsets) --- lib/core/common.py | 5 +---- 1 file changed, 1 insertion(+), 4 deletions(-) diff --git a/lib/core/common.py b/lib/core/common.py index d9fd5b377..1ebae59a6 100644 --- a/lib/core/common.py +++ b/lib/core/common.py @@ -1839,10 +1839,7 @@ def getUnicode(value, encoding=None, system=False, noneToNull=False): if isinstance(value, unicode): return value elif isinstance(value, basestring): - try: - return unicode(value, encoding or kb.pageEncoding) - except: - return unicode(value, UNICODE_ENCODING, "replace") + return unicode(value, encoding or kb.pageEncoding or UNICODE_ENCODING, "replace") else: return unicode(value) # encoding ignored for non-basestring instances else: