Commit ed481857 authored by Lance Stout's avatar Lance Stout

Fix unicode conversion in Python3

parent 8b29900b
......@@ -8,7 +8,10 @@ def unicode(text):
text = text.decode('utf-8')
import __builtin__
return __builtin__.unicode(text)
return str(text)
elif not isinstance(text, str):
return text.decode('utf-8')
return text
def bytes(text):
......@@ -148,4 +151,4 @@ def setdefaultencoding(encoding):
if func is None:
raise RuntimeError("Could not find setdefaultencoding")
sys.setdefaultencoding = func
return func(encoding)
\ No newline at end of file
return func(encoding)
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment