维基百科上的汉字编码是什么? [英] What is the encoding of Chinese characters on Wikipedia?
本文介绍了维基百科上的汉字编码是什么?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!
问题描述
我在看维基百科上的汉字编码,我无法弄清楚他们使用的是什么。例如的编码为%E7%9A%84(见这里)。这是三个字节,但是在此页上描述的编码中没有一个使用三个字节表示中文字符。 UTF-8例如使用2个字节。
I was looking at the encoding of Chinese characters on Wikipedia and I'm having trouble figuring out what they are using. For instance "的" is encoded as "%E7%9A%84" (see here). That's three bytes, however none of the encodings described on this page uses three bytes to represent Chinese characters. UTF-8 for instance uses 2 bytes.
我基本上试图将这三个字节匹配到一个实际的字符。关于如何编码的任何建议?
I'm basically trying to match these three bytes to an actual character. Any suggestion on how what encoding it could be?
推荐答案
>>> c='\xe7\x9a\x84'.decode('utf8')
>>> c
u'\u7684'
>>> print c
的
虽然Unicode以16位编码,utf8它减少到3个字节。
though Unicode encodes it in 16 bits, utf8 breaks it down to 3 bytes.
这篇关于维基百科上的汉字编码是什么?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!
查看全文