Why can two visually identical accented labels fail to match?
NFC gives canonically equivalent sequences a common representation, making some visually identical labels comparable at the code-point level.
Python example and interpretation
A single character or an e plus an accent can both spell é. Preserve the source text and normalize the lookup key. NFC does not fix spelling mistakes.
import unicodedata as u
a='e\u0301'
[a=='é',u.normalize('NFC',a)=='é']Result [False, True]
中文
看起来相同的重音标签为什么不能直接匹配?
Unicode NFC 把规范等价的组合序列转换成统一表示,使部分外观相同但码点不同的标签可以比较。
Python 算例与适用条件
用一个字符或用 e 加重音都可写出 é。保存原始文本,同时对检索键做规范化;NFC 不负责消除拼写差异。
import unicodedata as u
a='e\u0301'
[a=='é',u.normalize('NFC',a)=='é']结果 [False, True]