// DEV / UNICODE

Unicode 编解码Unicode Encoder

在文本与 \uXXXX、U+ 码点、HTML 实体之间互转,支持 emoji。Convert text to and from \uXXXX escapes, U+ code points and HTML entities, emoji included.

只转义非 ASCII 字符,可打印 ASCII 保持原样。JS 转义下 BMP 外字符(多数 emoji)会拆成正确的代理对,码点格式则保持完整的一个码点。Only non-ASCII characters are escaped; printable ASCII stays as-is. JS escape writes astral characters (most emoji) as a valid surrogate pair, while code point format keeps one code point per character.

输入内容后实时转换,空输入不会产生结果。Type something to convert in real time. Empty input produces no output.

结果Result

常见问题FAQ

Unicode 工具支持哪些写法?Which Unicode notations are supported?

支持 \uXXXX、\u{1F600}、U+1F600、{、😀 五种写法,混在一段文本里也能分别识别。Five forms are recognized: \uXXXX, \u{1F600}, U+1F600, { and 😀, even when they are mixed inside one string.

emoji 能正确编码吗?Are emoji encoded correctly?

能。按码点处理而不是按 UTF-16 单元,BMP 之外的字符会正确输出为代理对,不会出现乱码。Yes. Characters are processed by code point rather than UTF-16 unit, so characters outside the BMP are emitted as correct surrogate pairs.

同类工具Related tools

所有计算都在你的浏览器本地完成,输入内容不会上传到任何服务器。Everything runs locally in your browser. Nothing you type is ever uploaded to a server.