已知GBK的某段码表,码表对应的字符

Posted 学院派的驴

tags:

篇首语:本文由小常识网(cha138.com)小编为大家整理,主要介绍了已知GBK的某段码表,码表对应的字符相关的知识,希望对你有一定的参考价值。

  for i in range(0xA1A2,0xA1A5):                                                                                                 
        b1=i&0xFF;                                                                                                                 
        b2=i>>8;                                                                                                                   
        GBKChar1=chr(b2);                                                                                                          
        GBKChar2=chr(b1);                                                                                                          
        GBKChar=GBKChar1+GBKChar2;                                                                                                 
        print "%s\t%0X%0X"%(GBKChar,b2,b1);                                                                                        
    for i in range(0xA1AE,0xA1C0):                                                                                                 
        b1=i&0xFF;                                                                                                                 
        b2=i>>8;                                                                                                                   
        GBKChar1=chr(b2);                                                                                                          
        GBKChar2=chr(b1);                                                                                                          
        GBKChar=GBKChar1+GBKChar2;                                                                                                 
        print "%s\t%0X%0X"%(GBKChar,b2,b1);                                                                                        
    for i in range(0xA3A1,0xA3B0):                                                                                                 
        b1=i&0xFF;                                                                                                                 
        b2=i>>8;                                                                                                                   
        GBKChar1=chr(b2);                                                                                                          
        GBKChar2=chr(b1);                                                                                                          
        GBKChar=GBKChar1+GBKChar2;                                                                                                 
        print "%s\t%0X%0X"%(GBKChar,b2,b1);                                                                                        
    for i in range(0xA3BA,0xA3C0):                                                                                                 
        b1=i&0xFF;                                                                                                                 
        b2=i>>8;                                                                                                                   
        GBKChar1=chr(b2);                                                                                                          
        GBKChar2=chr(b1);                                                                                                          
        GBKChar=GBKChar1+GBKChar2;                                                                                                 
        print "%s\t%0X%0X"%(GBKChar,b2,b1)

以上是关于已知GBK的某段码表,码表对应的字符的主要内容,如果未能解决你的问题,请参考以下文章

java编码与解码

74. 编码与解码

字符编码及文件操作

unicode与字符编码

IO流

补充:字符编码ASCII ISO8859-1GB2312GBKUnicodeUTF-8