Are ASCII characters always encoded the same way i

2019-05-26 14:57发布

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?

3条回答
Melony?
2楼-- · 2019-05-26 15:39

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.

查看更多
萌系小妹纸
3楼-- · 2019-05-26 15:42

No, there are some unofficial regional variants of ISO-646 which differ quite a lot from ASCII.

查看更多
我只想做你的唯一
4楼-- · 2019-05-26 15:42

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.

查看更多
登录 后发表回答