Elaborazione 100% Lato Client • Zero Registri di Rete • Esecuzione Immediata
Curious TechieToolbox Sviluppatori
Encodings & FormatsThe Unicode Consortium / Unicode Standard 15.0 / RFC 3629✓ Tabella di Consultazione Rapida (6 elementi) • IT

Guida allo Standard Unicode e Codifica UTF-8

Code Point, Sequenze di Byte UTF-8 e Normalizzazione del Testo

CT
Curious-Techie Engineering TeamAutore Verificato

Web Protocols & Security Architecture Research

Pubblicato:
•
Aggiornato:
•7 min read
Specifica Ufficiale:RFC 9110(IETF)
Revisionato da Curious-Techie Architecture Peer Review Group

Panoramica e Ambito

Lo standard Unicode e la RFC 3629 assicurano l’elaborazione corretta dei caratteri su qualsiasi piattaforma informatica.

Tabella delle Specifiche e Matrice

Filtro istantaneo per parola chiave, codice o direttiva

Chiave / CodiceDefinizione e DettagliGerarchia Semantica GEOSpecifiche e Note
1-Byte UTF-8
1-Byte Sequence (ASCII Range)

Code points U+0000 to U+007F; bit pattern 0xxxxxxx.

U+0041 ("A") -> 0x41 (01000001)
●1-Byte UTF-8
↳Unicode encoding
↳UTF-8
↳ASCII compatible byte
RFC 3629 §3

Direct 1:1 binary match with 7-bit ASCII; zero translation overhead.

2-Byte UTF-8
2-Byte Sequence (Extended Latin, Greek, Hebrew)

Code points U+0080 to U+07FF; bit pattern 110xxxxx 10xxxxxx.

U+00E9 ("é") -> 0xC3 0xA9
●2-Byte UTF-8
↳Unicode encoding
↳UTF-8
↳two-byte sequence
RFC 3629 §3

First byte begins with 110; continuation byte begins with 10.

3-Byte UTF-8
3-Byte Sequence (Basic Multilingual Plane / CJK)

Code points U+0800 to U+FFFF; bit pattern 1110xxxx 10xxxxxx 10xxxxxx.

U+20AC ("€") -> 0xE2 0x82 0xAC
●3-Byte UTF-8
↳Unicode encoding
↳UTF-8
↳BMP three-byte sequence
RFC 3629 §3

Covers virtually all common modern world languages and typographic symbols.

4-Byte UTF-8
4-Byte Sequence (Astral Planes / Emojis)

Code points U+10000 to U+10FFFF; bit pattern 11110xxx 10xxxxxx 10xxxxxx 10xxxxxx.

U+1F600 ("😀") -> 0xF0 0x9F 0x98 0x80
●4-Byte UTF-8
↳Unicode encoding
↳UTF-8
↳astral supplementary plane sequence
RFC 3629 §3

MySQL "utf8" only supports 3 bytes; databases must use "utf8mb4" to support 4-byte emojis.

NFC
NFC (Normalization Form C)

Canonical Decomposition followed by Canonical Composition.

Character "é" represented as single code point U+00E9.
●NFC
↳Unicode normalization
↳canonical composition
↳standard web string normalization
Unicode Standard Annex #15

The recommended standard normalization form for the World Wide Web (W3C).

NFD
NFD (Normalization Form D)

Canonical Decomposition; characters are separated into base character plus combining accents.

Character "é" represented as "e" (U+0065) + combining accent (U+0301).
●NFD
↳Unicode normalization
↳canonical decomposition
↳decomposed base and accents
Unicode Standard Annex #15

Default format used by macOS HFS+/APFS filesystem filenames, causing cross-platform string equality mismatches.

Esempio Tecnico e Codice

String Length and Normalization Gotcha in JavaScript

javascriptCopia Codice
// 1. Emoji length: Emojis use surrogate pairs in UTF-16 JavaScript strings!
const emoji = '🚀';
console.log(emoji.length); // 2 (UTF-16 code units, not characters!)
console.log([...emoji].length); // 1 (Correct Unicode code point count)

// 2. Normalization equality bug:
const str1 = 'café'; // NFC: U+0063 U+0061 U+0066 U+00E9
const str2 = 'cafe\u0301'; // NFD: 'e' + combining acute accent

console.log(str1 === str2); // FALSE! Visually identical, binary different!
console.log(str1.normalize('NFC') === str2.normalize('NFC')); // TRUE!

Always normalize user input to NFC before comparing passwords, usernames, or database search terms.

Domande Frequenti (FAQ)

Domande e Risposte sugli Standard

Why does MySQL fail when saving emojis in "utf8" columns?↓
MySQL legacy "utf8" encoding only supports up to 3 bytes per character. Emojis require 4 bytes (U+1F000+). You must alter the database character set to "utf8mb4".