Unicode和UTF-8有什么区别? [英] What's the difference between Unicode and UTF-8?

查看:112
本文介绍了Unicode和UTF-8有什么区别?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

考虑:

unicode=utf16是真的吗?

许多人都说Unicode是一种标准,而不是一种编码,但是大多数编辑器实际上都支持另存为Unicode encoding .

Many are saying Unicode is a standard, not an encoding, but most editors support save as Unicode encoding actually.

推荐答案

大多数编辑器实际上都支持另存为"Unicode"编码.

most editors support save as ‘Unicode’ encoding actually.

这是Windows不幸的错误命名.

This is an unfortunate misnaming perpetrated by Windows.

因为Windows内部使用UTF-16LE编码作为Unicode字符串的内存存储格式,所以它认为这是Unicode文本的自然编码.在Windows世界中,存在ANSI字符串(当前计算机上的系统代码页,受完全不可移植性的影响)和Unicode字符串(内部存储为UTF-16LE).

Because Windows uses UTF-16LE encoding internally as the memory storage format for Unicode strings, it considers this to be the natural encoding of Unicode text. In the Windows world, there are ANSI strings (the system codepage on the current machine, subject to total unportability) and there are Unicode strings (stored internally as UTF-16LE).

所有这些都是在Unicode的早期设计的,当时我们意识到UCS-2还不够,而UTF-8才被发明.这就是Windows对UTF-8的全面支持差的原因.

This was all devised in the early days of Unicode, before we realised that UCS-2 wasn't enough, and before UTF-8 was invented. This is why Windows's support for UTF-8 is all-round poor.

这种误导的命名方案成为用户界面的一部分.使用Windows的编码支持来提供多种编码的文本编辑器会自动并不合适地将UTF-16LE描述为"Unicode",并将UTF-16BE(如果提供)描述为"Unicode big-endian".

This misguided naming scheme became part of the user interface. A text editor that uses Windows's encoding support to provide a range of encodings will automatically and inappropriately describe UTF-16LE as "Unicode", and UTF-16BE, if provided, as "Unicode big-endian".

(其他自己进行编码的编辑器,例如Notepad ++,则没有此问题.)

(Other editors that do encodings themselves, like Notepad++, don't have this problem.)

如果让您感觉更好,那么"ANSI"字符串也不基于任何ANSI标准.

If it makes you feel any better about it, ‘ANSI’ strings aren't based on any ANSI standard, either.

这篇关于Unicode和UTF-8有什么区别?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆