Literal strings are unicode by default in Python3.

Assuming that text is a bytes object, just use text.decode('utf-8')

unicode of Python2 is equivalent to str in Python3, so you can also write:

str(text, 'utf-8')

if you prefer.

Answer from John La Rooy on Stack Overflow
🌐
Python documentation
docs.python.org › 3 › howto › unicode.html
Unicode HOWTO — Python 3.14.7 documentation
Since Python 3.0, the language’s str type contains Unicode characters, meaning any string created using "unicode rocks!", 'unicode rocks!', or the triple-quoted string syntax is stored as Unicode.
🌐
Real Python
realpython.com › python-encodings-guide
Unicode & Character Encodings in Python: A Painless Guide – Real Python
May 20, 2019 - Python 3 source code is assumed to be UTF-8 by default. This means that you don’t need # -*- coding: UTF-8 -*- at the top of .py files in Python 3. All text (str) is Unicode by default. Encoded Unicode text is represented as binary data (bytes).
🌐
Akamai
akamai.com › cloud › guides › how-to-use-unicode-in-python3
Using Unicode in Python 3 | Linode Docs
March 20, 2023 - Python handles Unicode very differently in Python 2 and Python 3. In Python 2, the default encoding is ASCII. But in Python 3, UTF-8 is the default. This makes text processing much easier than before.
🌐
Python for Network Engineers
pyneng.readthedocs.io › en › latest › book › 16_unicode › python_3_unicode.html
Unicode in Python 3 - Python for network engineers
Function ord() returns value of Unicode code for character: ... Bytes are an immutable sequence of bytes. Bytes are denoted in the same way as strings but with addition of letter b before string: In [30]: b1 = b'\xd0\xb4\xd0\xb0' In [31]: b2 = b"\xd0\xb4\xd0\xb0" In [32]: b3 = b'''\xd0\xb4...
🌐
Python
docs.python.org › 3 › c-api › unicode.html
Unicode Objects and Codecs — Python 3.14.7 documentation
Unicode Objects: Since the implementation of PEP 393 in Python 3.3, Unicode objects internally use a variety of representations, in order to allow handling the complete range of Unicode characters ...
🌐
GeeksforGeeks
geeksforgeeks.org › python › working-with-unicode-in-python
Working with Unicode in Python - GeeksforGeeks
July 23, 2025 - Below are some of the ways by which we can work with Unicode in Python: ... Encoding, the process of representing data in a computer-readable form, is crucial for internationalized data in Python 3. The default string encoding is UTF-8. Let's create ...
🌐
Armin Ronacher
lucumr.pocoo.org › 2014 › 1 › 5 › unicode-in-2-and-3
More About Unicode in Python 2 and 3 | Armin Ronacher's Thoughts and Writings
January 5, 2014 - The main difference between Python 2 and Python 3 is the basic types that exist to deal with texts and bytes. On Python 3 we have one text type: str which holds Unicode data and two byte types bytes and bytearray.
Find elsewhere
🌐
Python
docs.python.org › 3.0 › howto › unicode.html
Unicode HOWTO — Python v3.0.1 documentation
Now that you’ve learned the rudiments of Unicode, we can look at Python’s Unicode features. Since Python 3.0, the language features a str type that contain Unicode characters, meaning any string created using "unicode rocks!", 'unicode rocks!, or the triple-quoted string syntax is stored ...
🌐
EDUCBA
educba.com › home › software development › software development tutorials › python 3 tutorial › python 3 unicode
Python 3 Unicode | Learn How to Use Python 3 Unicode?
May 13, 2024 - Strings were saved as bytes, with str being the default type. In Python 3, we used a distinct type called Unicode to preserve Unicode strings and prefix the string with “u” when it was created.
Address: Unit no. 202, Jay Antariksh Bldg, Makwana Road, Marol, Andheri (East),, 400059, Mumbai
🌐
freeCodeCamp
freecodecamp.org › news › a-beginner-friendly-guide-to-unicode-d6d45a903515
A Beginner-Friendly Guide to Unicode in Python
July 18, 2018 - Internally, Sublime Text still represents each of our “Windows-1258 decoded” characters as a Unicode code point, as we see below when we fire up the console: ... # Python 3 strings are "immutable sequences of Unicode code points">>> type(view.substr(0))<class 'str'>
🌐
Altervista
wolfprojects.altervista.org › talks › unicode-and-python-3
Unicode and Python 3 - Ezio Melotti
can represent all the Unicode chars · multibyte character encodings · UTF-8 → 1, 2, 3 or 4 bytes · UTF-16 → 2 or 4 bytes · UTF-32 → 4 bytes · UTF-8 · always use UTF-8 for your data · default encoding in lot of places · if you don't know the encoding, assume UTF-8 · Python supports ...
🌐
Armin Ronacher
lucumr.pocoo.org › 2014 › 5 › 12 › everything-about-unicode
Everything you did not want to know about Unicode in Python 3 | Armin Ronacher's Thoughts and Writings
May 12, 2014 - In Python 3 we’re doing Unicode right as developers. Apparently. I suppose what means is that all text data is Unicode and all non text data is bytes. In this wonderful world of everything being black and white, the “Hello World” example is pretty straightforward.
🌐
Better Programming
betterprogramming.pub › strings-unicode-and-bytes-in-python-3-everything-you-always-wanted-to-know-27dc02ff2686
Strings, Unicode, and Bytes in Python 3: Everything You Always Wanted to Know | by Andrea Colangelo | Better Programming
July 8, 2019 - Arguably the most significant new features introduced in Python 3 are the new implementation of str as Unicode by default and the strict separation between text and binary data.
🌐
Kumar303
kumar303.github.io › unicode-in-python
Unicode In Python, Completely Demystified
Glimpse at Unicode in Python 3 · Ask lots of questions · Corrections? handle non-English languages · use 3rd party modules · accept arbitrary text input · you will love Unicode · you will hate Unicode · [form input] => [Python] => [HTML] accepts input as text ·
🌐
Tutorialspoint
tutorialspoint.com › python › python_unicode_system.htm
Python - Unicode System
UTF stands for Unicode Transformation Format. Python 3.0 onwards has built-in support for Unicode. The str type contains Unicode characters, hence any string created using single, double or the triple-quoted string syntax is stored as Unicode.
🌐
Diveintopython3
diveintopython3.net › strings.html
Strings - Dive Into Python 3
In Python 3, all strings are sequences of Unicode characters. There is no such thing as a Python string encoded in UTF-8, or a Python string encoded as CP-1252. “Is this string UTF-8?” is an invalid question. UTF-8 is a way of encoding characters as a sequence of bytes.