🌐
Python documentation
docs.python.org › 3 › howto › unicode.html
Unicode HOWTO — Python 3.14.7 documentation
A Unicode string is turned into a sequence of bytes that contains embedded zero bytes only where they represent the null character (U+0000). This means that UTF-8 strings can be processed by C functions such as strcpy() and sent through protocols that can’t handle zero bytes for anything other than end-of-string markers.
🌐
Python Reference
python-reference.readthedocs.io › en › latest › docs › functions › unicode.html
unicode — Python Reference (The Right Way) 0.1 documentation
If encoding and/or errors are given, unicode() will decode the object which can either be an 8-bit string or a character buffer using the codec for encoding. The encoding parameter is a string giving the name of an encoding; if the encoding is not known, LookupError is raised.
🌐
Real Python
realpython.com › python-encodings-guide
Unicode & Character Encodings in Python: A Painless Guide – Real Python
May 20, 2019 - This also means that the "\Uxxxxxxxx" form is the only escape sequence that is capable of holding any Unicode character. Note: Here’s a short function to convert strings that look like "U+10346" into something Python can work with.
🌐
Python
docs.python.org › 3 › c-api › unicode.html
Unicode Objects and Codecs — Python 3.14.7 documentation
Py_UCS4 *PyUnicode_4BYTE_DATA(PyObject *unicode)¶ · Return a pointer to the canonical representation cast to UCS1, UCS2 or UCS4 integer types for direct character access. No checks are performed if the canonical representation has the correct character size; use PyUnicode_KIND() to select the right function.
🌐
GeeksforGeeks
geeksforgeeks.org › python › working-with-unicode-in-python
Working with Unicode in Python - GeeksforGeeks
July 23, 2025 - Python's unicodedata module provides the normalize() function for normalizing Unicode strings.
🌐
Note.nkmk.me
note.nkmk.me › home › python
Convert Between Unicode Code Point and Character: chr, ord | note.nkmk.me
January 31, 2024 - In Python, the built-in chr() and ord() functions allow you to convert between Unicode code points and characters. Additionally, in string literals, characters can be represented by their hexadecimal ...
🌐
Python
docs.python.org › 3 › library › unicodedata.html
unicodedata — Unicode Database
The Unicode HOWTO for more information about Unicode and how to use this module. ... Look up character by name. If a character with the given name is found, return the corresponding character. If not found, KeyError is raised. For example: ... The characters returned by this function are the same as those produced by \N escape sequence in string literals.
🌐
LabEx
labex.io › tutorials › python-how-to-represent-unicode-characters-in-python-strings-398239
How to represent Unicode characters in Python strings | LabEx
In Python, you can represent Unicode characters in strings using the following methods: Unicode Literals: Prefix the string with the letter u to indicate that it contains Unicode characters.
Find elsewhere
🌐
Python Basics
python-basics-tutorial.readthedocs.io › en › latest › types › strings › encodings.html
Unicode and character encodings - Python Basics
are inverses of each other in that the Python function ord() converts an str character to its base=10 code point, while chr() does the opposite. Below is a more detailed look at each of these nine functions: On this page · Unicode and character encodings · Special characters and escape sequences ·
🌐
AskPython
askpython.com › python-modules › unicode-in-python-unicodedata
Unicode In Python - The unicodedata Module Explained - AskPython
February 16, 2023 - Similarly, odr() is an inbuilt function that takes a one-character Unicode string as input and returns the code point value. ... A string is a sequence of Unicode codepoints. These codepoints are converted into a sequence of bytes for efficient storage. This process is called character encoding. There are many encodings such as UTF-8,UTF-16,ASCII etc. By default, Python uses UTF-8 encoding.
🌐
DigitalOcean
digitalocean.com › community › tutorials › how-to-work-with-unicode-in-python
How To Work with Unicode in Python | DigitalOcean
The tutorial will cover the basics of Unicode in Python and how Python interprets Unicode characters. It covers the concepts of unicodedata and how to use th…
🌐
Python Cheat Sheet
pythonsheets.com › notes › basic › python-unicode.html
Unicode — Python Cheat Sheet
The main goal of this cheat sheet is to collect some common snippets which are related to Unicode. In Python 3, strings are represented by Unicode instead of bytes.
🌐
Linode
linode.com › docs › guides › how-to-use-unicode-in-python3
Using Unicode in Python 3 | Linode Docs
March 20, 2023 - For example, the Unicode bumblebee emoji is encoded in a three-byte format possessing the Unicode code point U+1F41D. To assign this emoji character to a variable using its escape sequence, pad it out to 0001F41D. After the character is assigned to a string, it can be printed out using the Python print function.
🌐
B-List
b-list.org › weblog › 2017 › sep › 05 › how-python-does-unicode
How Python does Unicode - James Bennett
September 5, 2017 - To create a str in Python 2, you can use the str() built-in, or string-literal syntax, like so: my_string = 'This is my string.'. To create an instance of unicode, you can use the unicode() built-in, or prefix a string literal with a u, like so: my_unicode = u'This is my Unicode string.'.
🌐
Pylonsproject
docs.pylonsproject.org › projects › pylons-webframework › en › latest › tutorials › understanding_unicode.html
Understanding Unicode — Pylons Framework 1.0.2 documentation
In order to send Unicode data via a socket or write it to a file you usually need to encode it to a series of bytes and then decode the data back to Unicode when reading it. You can of course perform the encoding manually reading a byte at the time but since encodings such as UTF-8 can have variable numbers of bytes per character it is usually much easier to use Python’s built-in support in the form of the codecs module. The codecs module includes a version of the open() function that returns a file-like object that assumes the file’s contents are in a specified encoding and accepts Unicode parameters for methods such as .read() and .write().
🌐
Python
docs.python.org › 3.3 › howto › unicode.html
Unicode HOWTO — Python 3.3.7 documentation
September 19, 2017 - The sys.getfilesystemencoding() function returns the encoding to use on your current system, in case you want to do the encoding manually, but there’s not much reason to bother. When opening a file for reading or writing, you can usually just provide the Unicode string as the filename, and it will be automatically converted to the right encoding for you:
🌐
GitHub
gist.github.com › seanh › 0a56cd528714496625662dd9136d0cd3
Unicode in Python · GitHub
A from __future__ import unicode_literals turns literal strings into unicode instead of byte strings. In either Python 2 or Python 3 you can force a literal byte string with b"..." or force a literal unicode string with u"...".