SyntaxFix
Write A Post
Hire A Developer
Questions
Literal strings are unicode by default in Python3.
Assuming that text is a bytes object, just use text.decode('utf-8')
text
bytes
text.decode('utf-8')
unicode of Python2 is equivalent to str in Python3, so you can also write:
unicode
str
str(text, 'utf-8')
if you prefer.