In python 3, by default they(Literal strings) are unicode.
Let's assume text as a bytes object, then use
text.decode('utf-8')
Since, unicode in python2 is equal to str in python3, you can write the code as:
str(text, 'utf-8')
If you like it.
Looking for python tutorial? Join python training course to gain more knowledge