您的位置:

汉字的ASCII码详解

一、汉字的ASCII码值范围

ASCII码是指美国信息交换标准代码(The American Standard Code for Information Interchange)

汉字的ASCII码值范围为0xB0A1到0xF7FE,共有6763个码位

二、汉字ASCII码是输出码吗

汉字的ASCII码不是输出码,因为它并不是所有的输入设备都应该输出汉字的ASCII码

三、汉字的ASCII码对照表

/* GB2312编码表 */
/* 第一位 */
0xA1A1,0xA1A2,0xA1A3,0xA1A4,0xA1A5,0xA1A6,0xA1A7,0xA1A8,0xA1A9,0xA1AA,0xA1AB,0xA1AC,0xA1AD,0xA1AE,0xA1AF,0xA1B0,
0xA1B1,0xA1B2,0xA1B3,0xA1B4,0xA1B5,0xA1B6,0xA1B7,0xA1B8,0xA1B9,0xA1BA,0xA1BB,0xA1BC,0xA1BD,0xA1BE,0xA1BF,0xA1C0,
0xA1C1,0xA1C2,0xA1C3,0xA1C4,0xA1C5,0xA1C6,0xA1C7,0xA1C8,0xA1C9,0xA1CA,0xA1CB,0xA1CC,0xA1CD,0xA1CE,0xA1CF,0xA1D0,
0xA1D1,0xA1D2,0xA1D3,0xA1D4,0xA1D5,0xA1D6,0xA1D7,0xA1D8,0xA1D9,0xA1DA,0xA1DB,0xA1DC,0xA1DD,0xA1DE,0xA1DF,0xA1E0,
0xA1E1,0xA1E2,0xA1E3,0xA1E4,0xA1E5,0xA1E6,0xA1E7,0xA1E8,0xA1E9,0xA1EA,0xA1EB,0xA1EC,0xA1ED,0xA1EE,0xA1EF,0xA1F0,
0xA1F1,0xA1F2,0xA1F3,0xA1F4,0xA1F5,0xA1F6,0xA1F7,0xA1F8,0xA1F9,0xA1FA,0xA1FB,0xA1FC,0xA1FD,0xA1FE,0xA2B1,0xA2B2,

/* 第二位*/
0xA2B3,0xA2B4,0xA2B5,0xA2B6,0xA2B7,0xA2B8,0xA2B9,0xA2BA,0xA2BB,0xA2BC,0xA2BD,0xA2BE,0xA2BF,0xA2C0,0xA2C1,0xA2C2,
0xA2C3,0xA2C4,0xA2C5,0xA2C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五、汉字的ASCII码负数

汉字的ASCII码可以是负数,负数在计算机中以补码的形式表示

例如:“你”字的ASCII码为-9075,补码为0xFFFFD4ED,其中FFFF是补码标识符,D4ED是原码的反码,即原码为-9075。

六、汉字的ASCII码转换

// 将Unicode转成ASCII码
function unicodeToASCII(str) {
    var res = "";
    for (var i = 0; i < str.length; i++) {
        res += str.charCodeAt(i).toString(16);
    }
    return res;
}

// 将ASCII码转成汉字
function ASCIIToUnicode(str) {
    var res = "";
    for (var i = 0; i < str.length; i += 2) {
        var code = parseInt(str.substr(i, 2), 16);
        res += String.fromCharCode(code);
    }
    return res;
}

七、汉字的ASCII码是多少

汉字的ASCII码是根据汉字的Unicode码进行转换后得到的,每个汉字的ASCII码都不同

八、汉字的ASCII码值是多少

汉字的ASCII码值是其对应的Unicode码的十进制值减去0x100

九、汉字的ASCII码查询

可以通过在线字典等工具查询汉字的ASCII码对应的Unicode值

十、汉字的ASCII码比字母大吗

汉字的ASCII码比字母大,因为汉字的编码范围更大。