编码 - 它是什么以及为什么我们需要它?
有人可以向我解释一下编码及其重要性吗?据我所知,我们有多种编码,并且每种编码的前 127 个字符都是相同的。
Can someone explaing me about encoding and its importance. I understand that we have various encodings and in each of them first 127 characters are same.
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(3)
阅读Joel Spolsky 关于该主题的优秀文章。
在讨论另一个答案时注意到的一个有趣的观点(我真的认为作者不需要删除)是字符集之间存在差异,(在其他作者的单词 - 不记得他的用户名)定义了整数和字符之间的映射(例如“大写 A 是 65”)和编码,它定义了如何在字节流中表示这些整数。大多数旧的字符集(例如 ASCII)只有一种非常简单的编码:每个整数恰好变成一个字节。另一方面,Unicode 字符集有许多不同的编码,但没有一个编码是同样简单的:UTF-8、UTF-16、UTF-32...
Read Joel Spolsky's excellent article on the subject.
An interesting point that was noted in the discussion of another answer (which I didn't really think the author needed to delete) is that there is a difference between a character set, which (in the other author's words - don't remember his username) defines a mapping between integers and characters (e.g. "Capital A is 65"), and an encoding, which defines how those integers are to be represented in a byte stream. Most old character sets, such as ASCII, have only one very simple encoding: each integer becomes exactly one byte. The Unicode character set, on the other hand, has many different encodings, none of which are equally simple: UTF-8, UTF-16, UTF-32...
除了Aasmund Eldhuset上面提到的文章之外,我发现这个 Tedx Talk 对于同一主题非常有趣且解释性强。
希望这有帮助!
Apart from the article above mentioned by Aasmund Eldhuset, I find this Tedx Talk really interesting and explanatory on the same topic.
Hope this helps!
我认为编码是将您的消息转换为未经授权的人无法读取的形式的技术,以便您可以保持机密。
I think encoding is the technique to convert your message into a form that is not readable to unauthorized persons so that you can maintain your secrecy.