UTF-32

Encoding & Standards

Encodage Unicode à largeur fixe utilisant exactement 4 octets par caractère, permettant un mappage direct des points de code au détriment de l'espace mémoire.

UTF-32 is the simplest Unicode encoding: every character uses exactly 4 bytes, and the value directly corresponds to the code point. This makes random access and character counting trivial.

However, UTF-32 uses 4x the memory of ASCII text and 2x that of UTF-16 for most common characters. It's rarely used for storage or transmission but can be convenient for internal string processing.

Python 3's internal string representation uses a variable-width encoding (Latin-1, UCS-2, or UCS-4) depending on the highest code point in the string, which is why `len('😀')` correctly returns 1.

Termes associés

BOM (BOM) BOM (BOM)
La marque d'ordre des octets (U+FEFF) placée en début de fichier texte pour indiquer l'ordre des octets (endianness) dans les encodages UTF-16/UTF-32.
Unité de code Unité de code
La combinaison minimale de bits utilisée pour encoder un caractère : 8 bits pour UTF-8, 16 bits pour UTF-16 et 32 bits pour UTF-32.
UTF-16 UTF-16
Encodage Unicode à largeur variable utilisant 2 ou 4 octets par caractère, employé en interne par JavaScript, Java et Windows.
UTF-8 UTF-8
Encodage Unicode à largeur variable utilisant de 1 à 4 octets par caractère, dominant sur le web (utilisé par plus de 98 % des sites web).

Outils associés

🔢 Recherche Unicode Recherche Unicode
Saisissez un point de code comme U+1F600 et obtenez l'emoji, les détails d'encodage, les octets UTF-8/16 et les entités HTML.