NFC (Canonical Composition)
정규화 형식 C: 분해 후 정규 재합성하여 가장 짧은 형식을 생성합니다. 데이터 저장 및 교환에 권장되며, 웹 표준 형식입니다.
NFC: The Web's Default Normal Form
NFC (Normalization Form C — Canonical Composition) is the most widely used Unicode normalization form. It works in two passes: first, it decomposes all characters into their canonical base + combining mark sequences (like NFD), then it recomposes them back into precomposed characters wherever the Unicode standard defines a canonical composition.
The result is the shortest canonical representation of a string. For most Latin-script text, NFC means characters like é, ü, and ñ are stored as single code points rather than two-code-point sequences. For text that is already in NFC (pure ASCII, for instance), normalization is a no-op.
Why NFC is the Recommended Default
The W3C mandates NFC for all web content in the Character Model for the World Wide Web. Most databases, APIs, and programming environments assume NFC. HTTP headers, JSON payloads, and HTML source files are all expected to use NFC.
macOS user-space applications generally use NFC (despite HFS+ using NFD internally — the OS translates at the file system boundary). Windows and Linux also default to NFC in most contexts. If you are writing text to a file, database, or API and you want maximum interoperability, NFC is the right choice.
Python Examples
import unicodedata
# e + combining acute → é (one code point)
decomposed = "e\u0301" # NFD form: 2 code points
composed = unicodedata.normalize("NFC", decomposed)
print(repr(decomposed)) # 'e\u0301'
print(repr(composed)) # '\xe9' (which is é, U+00E9)
print(len(decomposed)) # 2
print(len(composed)) # 1
# Normalize user input before storing
def store_text(text: str) -> str:
return unicodedata.normalize("NFC", text)
# NFC is idempotent
s = "caf\u00e9"
assert unicodedata.normalize("NFC", s) == s
assert unicodedata.is_normalized("NFC", s)
NFC does NOT fold compatibility characters. The fi ligature fi (U+FB01) remains fi under NFC. For search and identifier normalization where you want fi == fi, use NFKC instead.
Quick Facts
| Property | Value |
|---|---|
| Full name | Normalization Form Canonical Composition |
| Algorithm | NFD first, then canonical composition |
| Typical use | Web content, databases, API responses, user input storage |
| W3C standard | Required for all web content (Character Model for the WWW) |
| Python | unicodedata.normalize("NFC", s) |
| Handles compatibility chars? | No — use NFKC for that |
| Idempotent? | Yes |
| Comparison to NFD | Usually equal or shorter (composed chars save one code point each) |
관련 용어
알고리즘의 더 많은 용어
Mapping characters to a common case form for case-insensitive comparison. More comprehensive …
Rules (UAX#29) for determining where one user-perceived character ends and another begins. …
정규화 형식 D: 재합성 없이 완전히 분해합니다. macOS HFS+ 파일 시스템에서 사용됩니다. …
정규화 형식 KC: 호환 분해 후 정규 합성. 시각적으로 유사한 문자를 통합합니다(fi→fi, …
정규화 형식 KD: 재합성 없이 호환 분해. 가장 강력한 정규화 방식으로 서식 …
Comparing Unicode strings requires normalization (NFC/NFD) and optionally collation (locale-aware sorting). Binary …
유니코드 단어 경계 규칙에 따라 결정된 단어 사이의 위치. 단순히 공백으로 분리하는 …
유니코드 규칙에 따른 문장 사이의 위치. 마침표로만 분리하는 것보다 복잡하며, 약어(Mr.), 생략 …
문자 양방향 범주와 명시적 방향 재정의를 사용하여 혼합 방향 텍스트(예: 영어 + …
유니코드 텍스트를 표준 정규 형식으로 변환하는 과정. 네 가지 형식: NFC(합성), NFD(분해), …