编码 - 它是什么,为什么我们需要它? [英] Encoding - what is it and why do we need it?

查看:105
本文介绍了编码 - 它是什么,为什么我们需要它?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

有人可以解释我的编码及其重要性。我明白我们有各种各样的编码,每个字符的前127个字符都相同。

解决方案

阅读 Joel Spolsky关于这个主题的优秀文章



一个有趣的在另一个答案(我并不认为作者需要删除)的讨论中注意到的一点是,字符集之间存在区别,(另一个作者的话)不记得他的用户名)定义整数和字符之间的映射(例如资本A为65)和编码,它定义了如何在字节流中表示整数。大多数老字符集,如ASCII,只有一个非常简单的编码:每个整数就只有一个字节。另一方面,Unicode字符集具有许多不同的编码,其中没有一个同样简单:UTF-8,UTF-16,UTF-32 ...


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.

解决方案

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...

这篇关于编码 - 它是什么,为什么我们需要它?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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