Switch to side-by-side view
--- a/Allura/allura/lib/helpers.py +++ b/Allura/allura/lib/helpers.py @@ -45,12 +45,14 @@ pass encoding = chardet.detect(s[:1024])['encoding'] try: - return unicode(s, encoding) + if encoding: + return unicode(s, encoding) except UnicodeDecodeError: pass encoding = chardet.detect(s)['encoding'] try: - return unicode(s, encoding) + if encoding: + return unicode(s, encoding) except UnicodeDecodeError: pass return unicode(repr(str(s)))[1:-1]