back to roots

This commit is contained in:
Miroslav Stampar 2011-01-19 14:06:26 +00:00
parent c1f6bf2eda
commit 89e0fd0709

View File

@ -1518,10 +1518,7 @@ def getUnicode(value, encoding=None):
if isinstance(value, unicode): if isinstance(value, unicode):
return value return value
elif isinstance(value, basestring): elif isinstance(value, basestring):
if encoding and encoding != conf.dataEncoding: return unicode(value, encoding or conf.dataEncoding, errors='replace')
# transencoding from encoding to conf.dataEncoding
value = unicode(value, encoding, errors='replace').encode(conf.dataEncoding)
return unicode(value, conf.dataEncoding)
else: else:
return unicode(value) # encoding ignored for non-basestring instances return unicode(value) # encoding ignored for non-basestring instances