{"id":161,"date":"2017-05-13T20:04:44","date_gmt":"2017-05-13T12:04:44","guid":{"rendered":"http:\/\/zouyang1230.com\/blog\/?p=161"},"modified":"2020-10-28T22:46:57","modified_gmt":"2020-10-28T14:46:57","slug":"%e5%ad%97%e7%ac%a6%e9%9b%86ascii-gb2312-gbk-unicode","status":"publish","type":"post","link":"http:\/\/www.imzouyang.com\/blog\/archives\/161.html","title":{"rendered":"\u5b57\u7b26\u96c6(ASCII GB2312 GBK Unicode)"},"content":{"rendered":"<p>\u56e0\u4e3a\u8ba1\u7b97\u673a\u53ea\u80fd\u5904\u7406\u6570\u5b57\uff0c\u5982\u679c\u8981\u5904\u7406\u6587\u672c\uff0c\u5c31\u5fc5\u987b\u5148\u628a\u6587\u672c\u8f6c\u6362\u4e3a\u6570\u5b57\u624d\u80fd\u5904\u7406\u3002\u6700\u65e9\u7684\u8ba1\u7b97\u673a\u5728\u8bbe\u8ba1\u65f6\u91c7\u75288\u4e2a\u6bd4\u7279\uff08bit\uff09\u4f5c\u4e3a\u4e00\u4e2a\u5b57\u8282\uff08byte\uff09\uff0c\u6240\u4ee5\uff0c\u4e00\u4e2a\u5b57\u8282\u80fd\u8868\u793a\u7684\u6700\u5927\u7684\u6574\u6570\u5c31\u662f255\uff08\u4e8c\u8fdb\u523611111111=\u5341\u8fdb\u5236255\uff09\uff0c\u5982\u679c\u8981\u8868\u793a\u66f4\u5927\u7684\u6574\u6570\uff0c\u5c31\u5fc5\u987b\u7528\u66f4\u591a\u7684\u5b57\u8282\u3002\u6bd4\u5982\u4e24\u4e2a\u5b57\u8282\u53ef\u4ee5\u8868\u793a\u7684\u6700\u5927\u6574\u6570\u662f65535\uff0c4\u4e2a\u5b57\u8282\u53ef\u4ee5\u8868\u793a\u7684\u6700\u5927\u6574\u6570\u662f4294967295\u3002<br \/>\n<br \/>\n\u7531\u4e8e\u8ba1\u7b97\u673a\u662f\u7f8e\u56fd\u4eba\u53d1\u660e\u7684\uff0c\u56e0\u6b64\uff0c\u6700\u65e9\u53ea\u6709127\u4e2a\u5b57\u6bcd\u88ab\u7f16\u7801\u5230\u8ba1\u7b97\u673a\u91cc\uff0c\u4e5f\u5c31\u662f\u5927\u5c0f\u5199\u82f1\u6587\u5b57\u6bcd\u3001\u6570\u5b57\u548c\u4e00\u4e9b\u7b26\u53f7\uff0c\u8fd9\u4e2a\u7f16\u7801\u8868\u88ab\u79f0\u4e3aASCII\u7f16\u7801\uff0c\u6bd4\u5982\u5927\u5199\u5b57\u6bcdA\u7684\u7f16\u7801\u662f65\uff0c\u5c0f\u5199\u5b57\u6bcdz\u7684\u7f16\u7801\u662f122\u3002<br \/>\n\u4f46\u662f\u8981\u5904\u7406\u4e2d\u6587\u663e\u7136\u4e00\u4e2a\u5b57\u8282\u662f\u4e0d\u591f\u7684\uff0c\u81f3\u5c11\u9700\u8981\u4e24\u4e2a\u5b57\u8282\uff0c\u800c\u4e14\u8fd8\u4e0d\u80fd\u548cASCII\u7f16\u7801\u51b2\u7a81\uff0c\u6240\u4ee5\uff0c\u4e2d\u56fd\u5236\u5b9a\u4e86GB2312\u7f16\u7801\uff0c\u7528\u6765\u628a\u4e2d\u6587\u7f16\u8fdb\u53bb\u3002<br \/>\n<br \/>\n\u4f60\u53ef\u4ee5\u60f3\u5f97\u5230\u7684\u662f\uff0c\u5168\u4e16\u754c\u6709\u4e0a\u767e\u79cd\u8bed\u8a00\uff0c\u65e5\u672c\u628a\u65e5\u6587\u7f16\u5230Shift_JIS\u91cc\uff0c\u97e9\u56fd\u628a\u97e9\u6587\u7f16\u5230Euc-kr\u91cc\uff0c\u5404\u56fd\u6709\u5404\u56fd\u7684\u6807\u51c6\uff0c\u5c31\u4f1a\u4e0d\u53ef\u907f\u514d\u5730\u51fa\u73b0\u51b2\u7a81\uff0c\u7ed3\u679c\u5c31\u662f\uff0c\u5728\u591a\u8bed\u8a00\u6df7\u5408\u7684\u6587\u672c\u4e2d\uff0c\u663e\u793a\u51fa\u6765\u4f1a\u6709\u4e71\u7801\u3002<br \/>\n<br \/>\n\u56e0\u6b64\uff0cUnicode\u5e94\u8fd0\u800c\u751f\u3002Unicode\u628a\u6240\u6709\u8bed\u8a00\u90fd\u7edf\u4e00\u5230\u4e00\u5957\u7f16\u7801\u91cc\uff0c\u8fd9\u6837\u5c31\u4e0d\u4f1a\u518d\u6709\u4e71\u7801\u95ee\u9898\u4e86\u3002<br \/>\nUnicode\u6807\u51c6\u4e5f\u5728\u4e0d\u65ad\u53d1\u5c55\uff0c\u4f46\u6700\u5e38\u7528\u7684\u662f\u7528\u4e24\u4e2a\u5b57\u8282\u8868\u793a\u4e00\u4e2a\u5b57\u7b26\uff08\u5982\u679c\u8981\u7528\u5230\u975e\u5e38\u504f\u50fb\u7684\u5b57\u7b26\uff0c\u5c31\u9700\u89814\u4e2a\u5b57\u8282\uff09\u3002\u73b0\u4ee3\u64cd\u4f5c\u7cfb\u7edf\u548c\u5927\u591a\u6570\u7f16\u7a0b\u8bed\u8a00\u90fd\u76f4\u63a5\u652f\u6301Unicode\u3002<br \/>\n<br \/>\n\u73b0\u5728\uff0c\u634b\u4e00\u634bASCII\u7f16\u7801\u548cUnicode\u7f16\u7801\u7684\u533a\u522b\uff1aASCII\u7f16\u7801\u662f1\u4e2a\u5b57\u8282\uff0c\u800cUnicode\u7f16\u7801\u901a\u5e38\u662f2\u4e2a\u5b57\u8282\u3002<br \/>\n\u5b57\u6bcdA\u7528ASCII\u7f16\u7801\u662f\u5341\u8fdb\u5236\u768465\uff0c\u4e8c\u8fdb\u5236\u768401000001\uff1b<br \/>\n\u5b57\u7b260\u7528ASCII\u7f16\u7801\u662f\u5341\u8fdb\u5236\u768448\uff0c\u4e8c\u8fdb\u5236\u768400110000\uff0c\u6ce8\u610f\u5b57\u7b26&#8217;0&#8217;\u548c\u6574\u65700\u662f\u4e0d\u540c\u7684\uff1b<br \/>\n\u6c49\u5b57\u4e2d\u5df2\u7ecf\u8d85\u51fa\u4e86ASCII\u7f16\u7801\u7684\u8303\u56f4\uff0c\u7528Unicode\u7f16\u7801\u662f\u5341\u8fdb\u5236\u768420013\uff0c\u4e8c\u8fdb\u5236\u768401001110 00101101\u3002<br \/>\n\u4f60\u53ef\u4ee5\u731c\u6d4b\uff0c\u5982\u679c\u628aASCII\u7f16\u7801\u7684A\u7528Unicode\u7f16\u7801\uff0c\u53ea\u9700\u8981\u5728\u524d\u9762\u88650\u5c31\u53ef\u4ee5\uff0c\u56e0\u6b64\uff0cA\u7684Unicode\u7f16\u7801\u662f00000000 01000001\u3002<br \/>\n<br \/>\n\u65b0\u7684\u95ee\u9898\u53c8\u51fa\u73b0\u4e86\uff1a\u5982\u679c\u7edf\u4e00\u6210Unicode\u7f16\u7801\uff0c\u4e71\u7801\u95ee\u9898\u4ece\u6b64\u6d88\u5931\u4e86\u3002\u4f46\u662f\uff0c\u5982\u679c\u4f60\u5199\u7684\u6587\u672c\u57fa\u672c\u4e0a\u5168\u90e8\u662f\u82f1\u6587\u7684\u8bdd\uff0c\u7528Unicode\u7f16\u7801\u6bd4ASCII\u7f16\u7801\u9700\u8981\u591a\u4e00\u500d\u7684\u5b58\u50a8\u7a7a\u95f4\uff0c\u5728\u5b58\u50a8\u548c\u4f20\u8f93\u4e0a\u5c31\u5341\u5206\u4e0d\u5212\u7b97\u3002<br \/>\n\u6240\u4ee5\uff0c\u672c\u7740\u8282\u7ea6\u7684\u7cbe\u795e\uff0c\u53c8\u51fa\u73b0\u4e86\u628aUnicode\u7f16\u7801\u8f6c\u5316\u4e3a\u201c\u53ef\u53d8\u957f\u7f16\u7801\u201d\u7684UTF-8\u7f16\u7801\u3002UTF-8\u7f16\u7801\u628a\u4e00\u4e2aUnicode\u5b57\u7b26\u6839\u636e\u4e0d\u540c\u7684\u6570\u5b57\u5927\u5c0f\u7f16\u7801\u62101-6\u4e2a\u5b57\u8282\uff0c\u5e38\u7528\u7684\u82f1\u6587\u5b57\u6bcd\u88ab\u7f16\u7801\u62101\u4e2a\u5b57\u8282\uff0c\u6c49\u5b57\u901a\u5e38\u662f3\u4e2a\u5b57\u8282\uff0c\u53ea\u6709\u5f88\u751f\u50fb\u7684\u5b57\u7b26\u624d\u4f1a\u88ab\u7f16\u7801\u62104-6\u4e2a\u5b57\u8282\u3002\u5982\u679c\u4f60\u8981\u4f20\u8f93\u7684\u6587\u672c\u5305\u542b\u5927\u91cf\u82f1\u6587\u5b57\u7b26\uff0c\u7528UTF-8\u7f16\u7801\u5c31\u80fd\u8282\u7701\u7a7a\u95f4\uff1a<\/p>\n<blockquote><p>\u5b57\u7b26 ASCII Unicode UTF-8<br \/>\nA 01000001 00000000 01000001 01000001<br \/>\n\u4e2d x 01001110 00101101 11100100 10111000 10101101<\/p><\/blockquote>\n<p>\u4ece\u4e0a\u9762\u7684\u8868\u683c\u8fd8\u53ef\u4ee5\u53d1\u73b0\uff0cUTF-8\u7f16\u7801\u6709\u4e00\u4e2a\u989d\u5916\u7684\u597d\u5904\uff0c\u5c31\u662fASCII\u7f16\u7801\u5b9e\u9645\u4e0a\u53ef\u4ee5\u88ab\u770b\u6210\u662fUTF-8\u7f16\u7801\u7684\u4e00\u90e8\u5206\uff0c\u6240\u4ee5\uff0c\u5927\u91cf\u53ea\u652f\u6301ASCII\u7f16\u7801\u7684\u5386\u53f2\u9057\u7559\u8f6f\u4ef6\u53ef\u4ee5\u5728UTF-8\u7f16\u7801\u4e0b\u7ee7\u7eed\u5de5\u4f5c\u3002<br \/>\n\u641e\u6e05\u695a\u4e86ASCII\u3001Unicode\u548cUTF-8\u7684\u5173\u7cfb\uff0c\u6211\u4eec\u5c31\u53ef\u4ee5\u603b\u7ed3\u4e00\u4e0b\u73b0\u5728\u8ba1\u7b97\u673a\u7cfb\u7edf\u901a\u7528\u7684\u5b57\u7b26\u7f16\u7801\u5de5\u4f5c\u65b9\u5f0f\uff1a<br \/>\n\u5728\u8ba1\u7b97\u673a\u5185\u5b58\u4e2d\uff0c\u7edf\u4e00\u4f7f\u7528Unicode\u7f16\u7801\uff0c\u5f53\u9700\u8981\u4fdd\u5b58\u5230\u786c\u76d8\u6216\u8005\u9700\u8981\u4f20\u8f93\u7684\u65f6\u5019\uff0c\u5c31\u8f6c\u6362\u4e3aUTF-8\u7f16\u7801\u3002<br \/>\n\u7528\u8bb0\u4e8b\u672c\u7f16\u8f91\u7684\u65f6\u5019\uff0c\u4ece\u6587\u4ef6\u8bfb\u53d6\u7684UTF-8\u5b57\u7b26\u88ab\u8f6c\u6362\u4e3aUnicode\u5b57\u7b26\u5230\u5185\u5b58\u91cc\uff0c\u7f16\u8f91\u5b8c\u6210\u540e\uff0c\u4fdd\u5b58\u7684\u65f6\u5019\u518d\u628aUnicode\u8f6c\u6362\u4e3aUTF-8\u4fdd\u5b58\u5230\u6587\u4ef6<\/p>\n<p>ps\uff1a<br \/>\n1\u3001<br \/>\nASCII(American Standard Code for Information Interchange\uff0c\u7f8e\u56fd\u6807\u51c6\u4fe1\u606f\u4ea4\u6362\u4ee3\u7801)\u662f\u57fa\u4e8e\u62c9\u4e01\u5b57\u6bcd\u7684\u4e00\u5957\u7535\u8111\u7f16\u7801\u7cfb\u7edf\uff0c\u4e3b\u8981\u7528\u4e8e\u663e\u793a\u73b0\u4ee3\u82f1\u8bed\u548c\u5176\u4ed6\u897f\u6b27\u8bed\u8a00\u3002\u5b83\u662f\u73b0\u4eca\u6700\u901a\u7528\u7684\u5355\u5b57\u8282\u7f16\u7801\u7cfb\u7edf\uff0c\u5e76\u7b49\u540c\u4e8e\u56fd\u9645\u6807\u51c6ISO\/IEC 646\u3002<br \/>\n\u7531\u4e8e ASCII \u4f7f\u7528\u4e00\u4e2a\u5b57\u8282\uff087 \u4f4d\u8868\u793a\u5b57\u7b26\uff0c1 \u4f4d\u8868\u793a\u4f20\u8f93\u5947\u5076\u63a7\u5236\uff09\uff0c\u6240\u4ee5\u5b83\u53ea\u80fd\u8868\u793a 128 \u4e2a\u4e0d\u540c\u7684\u5b57\u7b26\u3002\u8fd9\u4e9b\u5b57\u7b26\u4e2d\u6709 32 \u4e2a\u88ab\u4fdd\u7559\u4f5c\u4e3a\u5176\u4ed6\u63a7\u5236\u76ee\u7684\u4f7f\u7528\u3002<br \/>\nASCII \u7684\u6700\u5927\u7684\u7f3a\u70b9\u662f\uff0c\u5b83\u6392\u9664\u4e86\u975e\u82f1\u6587\u5b57\u6bcd\u3002<br \/>\nASCII \u4eca\u5929\u4ecd\u7136\u5728\u5e7f\u6cdb\u4f7f\u7528\uff0c\u5c24\u5176\u662f\u5728\u5927\u578b\u8ba1\u7b97\u673a\u7cfb\u7edf\u4e2d\u3002<br \/>\n<br \/>\n2\u3001<br \/>\nUnicode \u8054\u76df\uff08Unicode Consortium\uff09\u5f00\u53d1\u4e86 Unicode \u6807\u51c6\uff08Unicode Standard\uff09\u3002\u4ed6\u4eec\u7684\u76ee\u6807\u662f\u4f7f\u7528\u6807\u51c6\u7684 Unicode \u8f6c\u6362\u683c\u5f0f\uff08\u5373 UTF\uff0c\u5168\u79f0 Unicode Transformation Format\uff09\u53d6\u4ee3\u73b0\u6709\u7684\u5b57\u7b26\u96c6\u3002<br \/>\nUnicode \u6807\u51c6\u662f\u4e00\u4e2a\u6210\u529f\u7684\u521b\u4e3e\uff0c\u5728 HTML\u3001XML\u3001Java\u3001JavaScript\u3001E-mail\u3001ASP\u3001PHP \u4e2d\u90fd\u5f97\u5230\u5b9e\u73b0\u3002Unicode \u6807\u51c6\u4e5f\u5f97\u5230\u8bb8\u591a\u64cd\u4f5c\u7cfb\u7edf\u548c\u6240\u6709\u73b0\u4ee3\u6d4f\u89c8\u5668\u7684\u652f\u6301\u3002<br \/>\nUnicode \u8054\u76df\u4e0e\u9886\u5148\u7684\u6807\u51c6\u5f00\u53d1\u7ec4\u7ec7\u5408\u4f5c\uff0c\u8fd9\u4e9b\u7ec4\u7ec7\u6709 ISO\u3001W3C \u548c ECMA\u3002<br \/>\nUnicode \u6807\u51c6\u8986\u76d6\u4e86\uff08\u51e0\u4e4e\uff09\u6240\u6709\u7684\u5b57\u7b26\u3001\u6807\u70b9\u7b26\u53f7\u548c\u7b26\u53f7\u3002<br \/>\n<br \/>\n3\u3001<br \/>\nGB 2312 \u6216 GB 2312-80 \u662f\u4e2d\u56fd\u56fd\u5bb6\u6807\u51c6\u7b80\u4f53\u4e2d\u6587\u5b57\u7b26\u96c6\uff0c\u5168\u79f0\u300a\u4fe1\u606f\u4ea4\u6362\u7528\u6c49\u5b57\u7f16\u7801\u5b57\u7b26\u96c6\u00b7\u57fa\u672c\u96c6\u300b\uff0c\u53c8\u79f0 GB 0\uff0c\u7531\u4e2d\u56fd\u56fd\u5bb6\u6807\u51c6\u603b\u5c40\u53d1\u5e03\uff0c1981 \u5e74 5 \u6708 1 \u65e5\u5b9e\u65bd\u3002GB 2312 \u7f16\u7801\u901a\u884c\u4e8e\u4e2d\u56fd\u5927\u9646\uff1b\u65b0\u52a0\u5761\u7b49\u5730\u4e5f\u91c7\u7528\u6b64\u7f16\u7801\u3002\u4e2d\u56fd\u5927\u9646\u51e0\u4e4e\u6240\u6709\u7684\u4e2d\u6587\u7cfb\u7edf\u548c\u56fd\u9645\u5316\u7684\u8f6f\u4ef6\u90fd\u652f\u6301 GB 2312\u3002GB 2312 \u6807\u51c6\u5171\u6536\u5f55 6763 \u4e2a\u6c49\u5b57\uff0c\u5176\u4e2d\u4e00\u7ea7\u6c49\u5b57 3755 \u4e2a\uff0c\u4e8c\u7ea7\u6c49\u5b57 3008 \u4e2a\uff1b\u540c\u65f6\u6536\u5f55\u4e86\u5305\u62ec\u62c9\u4e01\u5b57\u6bcd\u3001\u5e0c\u814a\u5b57\u6bcd\u3001\u65e5\u6587\u5e73\u5047\u540d\u53ca\u7247\u5047\u540d\u5b57\u6bcd\u3001\u4fc4\u8bed\u897f\u91cc\u5c14\u5b57\u6bcd\u5728\u5185\u7684 682 \u4e2a\u5b57\u7b26\u3002<br \/>\n<br \/>\n4\u3001<br \/>\nGBK \u5373\u6c49\u5b57\u5185\u7801\u6269\u5c55\u89c4\u8303\uff0cK \u4e3a\u6c49\u8bed\u62fc\u97f3 Kuo Zhan\uff08\u6269\u5c55\uff09\u4e2d\u201c\u6269\u201d\u5b57\u7684\u58f0\u6bcd\u3002\u82f1\u6587\u5168\u79f0 Chinese Internal Code Specification\u3002<br \/>\nGBK \u91c7\u7528\u53cc\u5b57\u8282\u8868\u793a\uff0cGBK \u5411\u4e0b\u4e0e GB 2312 \u5b8c\u5168\u517c\u5bb9\uff0c\u5411\u4e0a\u652f\u6301 ISO 10646 \u56fd\u9645\u6807\u51c6\uff0c\u5728\u524d\u8005\u5411\u540e\u8005\u8fc7\u6e21\u8fc7\u7a0b\u4e2d\u8d77\u5230\u7684\u627f\u4e0a\u542f\u4e0b\u7684\u4f5c\u7528\u3002<\/p>\n","protected":false},"excerpt":{"rendered":"<p>\u56e0\u4e3a\u8ba1\u7b97\u673a\u53ea\u80fd\u5904\u7406\u6570\u5b57\uff0c\u5982\u679c\u8981\u5904\u7406\u6587\u672c\uff0c\u5c31\u5fc5\u987b\u5148\u628a\u6587\u672c\u8f6c\u6362\u4e3a\u6570\u5b57\u624d\u80fd\u5904\u7406\u3002\u6700\u65e9\u7684\u8ba1\u7b97\u673a\u5728\u8bbe\u8ba1\u65f6\u91c7\u75288\u4e2a\u6bd4\u7279\uff08b &hellip; <a href=\"http:\/\/www.imzouyang.com\/blog\/archives\/161.html\" class=\"read-more\">\u7ee7\u7eed\u9605\u8bfb <span class=\"screen-reader-text sr-only\">\u5b57\u7b26\u96c6(ASCII GB2312 GBK Unicode)<\/span><\/a><\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"aside","meta":[],"categories":[30],"tags":[],"_links":{"self":[{"href":"http:\/\/www.imzouyang.com\/blog\/wp-json\/wp\/v2\/posts\/161"}],"collection":[{"href":"http:\/\/www.imzouyang.com\/blog\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"http:\/\/www.imzouyang.com\/blog\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"http:\/\/www.imzouyang.com\/blog\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"http:\/\/www.imzouyang.com\/blog\/wp-json\/wp\/v2\/comments?post=161"}],"version-history":[{"count":1,"href":"http:\/\/www.imzouyang.com\/blog\/wp-json\/wp\/v2\/posts\/161\/revisions"}],"predecessor-version":[{"id":1989,"href":"http:\/\/www.imzouyang.com\/blog\/wp-json\/wp\/v2\/posts\/161\/revisions\/1989"}],"wp:attachment":[{"href":"http:\/\/www.imzouyang.com\/blog\/wp-json\/wp\/v2\/media?parent=161"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"http:\/\/www.imzouyang.com\/blog\/wp-json\/wp\/v2\/categories?post=161"},{"taxonomy":"post_tag","embeddable":true,"href":"http:\/\/www.imzouyang.com\/blog\/wp-json\/wp\/v2\/tags?post=161"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}