🧬 Unicode 标准化Unicode Normalize
在 NFC / NFD / NFKC / NFKD 四种范式间互转,解决重音、合字、全角符号等「看起来一样却不相等」的比对/存储问题。也常用于清理从 PDF/网页复制来的怪异字符。Convert between NFC / NFD / NFKC / NFKD to fix accent, ligature and compatibility mismatches that look identical but compare unequal — handy for text copied from PDFs or web pages.
① 目标范式① Target Form
② 输入与输出② Input & Output
📚 什么是 Unicode 标准化?📚 What is Unicode normalization?
Unicode 允许同一个「看起来一样」的字符有不同编码。例如「é」既可以是一个码位 U+00E9(预组合),也可以是「e」+ 组合重音 U+0301(分解)。两条编码在屏幕上几乎看不出区别,但会导致字符串比较、排序、搜索、去重时结果不一致——这正是「看着一样却比不出来」的根源。Unicode lets the same-looking character have different encodings. “é” can be a single precomposed code point (U+00E9) or “e” + a combining accent (U+0301). The two encodings look identical but break comparison, sorting, search and dedup — the classic “looks the same but isn’t equal” problem.
四种范式:NFC/NFD 只处理组合字符(NFD 分解、NFC 尽量合成,语义不变);NFKC/NFKD 是「兼容分解」,还会把全角字母、圆角数字、连字符等折叠为最简形式(如 A→A、①②→12),常用于搜索与索引的规范化。注意 NFKC/NFKD 是有损的(可能改变含义),只应在确定不会误伤时使用。「ASCII 折叠」进一步把带变音字母转成纯 ASCII(café→cafe),适合生成文件名、Slug 与只支持 ASCII 的系统。The four forms: NFC/NFD handle combining characters only (NFD decomposes, NFC composes; semantics unchanged). NFKC/NFKD add compatibility decomposition, folding full-width letters, circled digits and ligatures to their simplest forms (A→A, ①②→12) — great for search/index normalization. Note NFKC/NFKD are lossy and can change meaning; use with care. “ASCII fold” further maps accented letters to plain ASCII (café→cafe) for filenames, slugs and ASCII-only systems.
使用说明How to use
- 输入含特殊字符的文本Enter text with special chars
- 选择 Unicode 标准化形式 NFC/NFD/NFKC/NFKDChoose a form: NFC/NFD/NFKC/NFKD
- 查看标准化结果Review the normalized text
示例:é 分解形式 → 合成单字Example: Decomposed é → composed
全程在你的浏览器本地完成,文本不会上传服务器。Runs entirely in your browser; your text is never uploaded.