在所有字符编码中,ASCII 字符的编码方式是否始终相同?
在 ASCII 中,字符 <被编码为单字节字符0x3C,我想知道是否存在一个字符集其中<编码不同吗?我试过UTF-8,是一样的。我试过GB2312,也是一样的...
另一个问题,所有字符集中的ASCII字符都一样吗?
In ASCII, the character < is encoded as a single-byte character 0x3C, what I'd like to know is that is there a character set where < is encoded differently? I tried UTF-8, it's the same. I tried GB2312 and it's the same...
Another question, are all ASCII characters the same in all character sets?
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(3)
ASCII 的前 127 个字符在所有 ASCII 派生字符集中都是相同的。它们在非 ASCII 字符集(例如 EBCDIC)中并不相同。
带代码的字符> 127 根据代码页和/或编码而有所不同。
The first 127 characters of ASCII are the same in all ASCII-derived character sets. They are not the same in non-ASCII-character sets (such as EBCDIC).
Characters with codes > 127 are different depending on the codepage and/or the encoding.
不,ISO-646 有一些非官方的区域变体,与 ASCII 有很大不同。
No, there are some unofficial regional variants of ISO-646 which differ quite a lot from ASCII.
在 UTF-16 中,'abc' 被编码为 '0 97 0 98 0 99',这与 ASCII 非常相似,但如果你尝试将其解释为 ASCII,你最终会在之前(或之后)得到一个额外的 NUL 字符,取决于字节顺序)每个字符。虽然差别不大,但足以使它们不可互换。
In UTF-16 'abc' is encoded as '0 97 0 98 0 99', which is very similar to ASCII, but if you try to interpret it as ASCII, you will end up with an extra NUL character before (or after, depending on endianness) each character. Not a huge difference, but enough to make them uninterchangable.