{"id":3157,"date":"2018-09-14T21:42:20","date_gmt":"2018-09-14T13:42:20","guid":{"rendered":"http:\/\/www.menglanglang.cn\/?p=3157"},"modified":"2019-07-27T21:24:36","modified_gmt":"2019-07-27T13:24:36","slug":"%e5%ad%97%e7%ac%a6%e7%bc%96%e7%a0%81","status":"publish","type":"post","link":"http:\/\/www.menglanglang.cn\/?p=3157","title":{"rendered":"\u5b57\u7b26\u7f16\u7801\u8be6\u7ec6\u4ecb\u7ecd"},"content":{"rendered":"<p>\u5b57\u7b26\u4e32\u6bd4\u8f83\u7279\u6b8a\u7684\u662f\u8fd8\u6709\u4e00\u4e2a\u7f16\u7801\u95ee\u9898\u3002<\/p>\n<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\u662f<code>65535<\/code>\uff0c4\u4e2a\u5b57\u8282\u53ef\u4ee5\u8868\u793a\u7684\u6700\u5927\u6574\u6570\u662f<code>4294967295<\/code>\u3002<\/p>\n<p>\u7531\u4e8e\u8ba1\u7b97\u673a\u662f\u7f8e\u56fd\u4eba\u53d1\u660e\u7684\uff0c\u56e0\u6b64\uff0c\u6700\u65e9\u53ea\u6709127\u4e2a\u5b57\u7b26\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\u4e3a<code>ASCII<\/code>\u7f16\u7801\uff0c\u6bd4\u5982\u5927\u5199\u5b57\u6bcd<code>A<\/code>\u7684\u7f16\u7801\u662f<code>65<\/code>\uff0c\u5c0f\u5199\u5b57\u6bcd<code>z<\/code>\u7684\u7f16\u7801\u662f<code>122<\/code>\u3002<\/p>\n<p>\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\u4e86<code>GB2312<\/code>\u7f16\u7801\uff0c\u7528\u6765\u628a\u4e2d\u6587\u7f16\u8fdb\u53bb\u3002<\/p>\n<p>\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\u5230<code>Shift_JIS<\/code>\u91cc\uff0c\u97e9\u56fd\u628a\u97e9\u6587\u7f16\u5230<code>Euc-kr<\/code>\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<\/p>\n<p>\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<\/p>\n<p>Unicode\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<\/p>\n<p>\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<\/p>\n<p>\u5b57\u6bcd<code>A<\/code>\u7528ASCII\u7f16\u7801\u662f\u5341\u8fdb\u5236\u7684<code>65<\/code>\uff0c\u4e8c\u8fdb\u5236\u7684<code>01000001<\/code>\uff1b<\/p>\n<p>\u5b57\u7b26<code>0<\/code>\u7528ASCII\u7f16\u7801\u662f\u5341\u8fdb\u5236\u7684<code>48<\/code>\uff0c\u4e8c\u8fdb\u5236\u7684<code>00110000<\/code>\uff0c\u6ce8\u610f\u5b57\u7b26<code>'0'<\/code>\u548c\u6574\u6570<code>0<\/code>\u662f\u4e0d\u540c\u7684\uff1b<\/p>\n<p>\u6c49\u5b57<code>\u4e2d<\/code>\u5df2\u7ecf\u8d85\u51fa\u4e86ASCII\u7f16\u7801\u7684\u8303\u56f4\uff0c\u7528Unicode\u7f16\u7801\u662f\u5341\u8fdb\u5236\u7684<code>20013<\/code>\uff0c\u4e8c\u8fdb\u5236\u7684<code>01001110 00101101<\/code>\u3002<\/p>\n<p>\u4f60\u53ef\u4ee5\u731c\u6d4b\uff0c\u5982\u679c\u628aASCII\u7f16\u7801\u7684<code>A<\/code>\u7528Unicode\u7f16\u7801\uff0c\u53ea\u9700\u8981\u5728\u524d\u9762\u88650\u5c31\u53ef\u4ee5\uff0c\u56e0\u6b64\uff0c<code>A<\/code>\u7684Unicode\u7f16\u7801\u662f<code>00000000 01000001<\/code>\u3002<\/p>\n<p>\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<\/p>\n<p>\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\u7684<code>UTF-8<\/code>\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<table class=\"uk-table\">\n<tbody>\n<tr>\n<th>\u5b57\u7b26<\/th>\n<th>ASCII<\/th>\n<th>Unicode<\/th>\n<th>UTF-8<\/th>\n<\/tr>\n<tr>\n<td>A<\/td>\n<td>01000001<\/td>\n<td>00000000 01000001<\/td>\n<td>01000001<\/td>\n<\/tr>\n<tr>\n<td>\u4e2d<\/td>\n<td>x<\/td>\n<td>01001110 00101101<\/td>\n<td>11100100 10111000 10101101<\/td>\n<\/tr>\n<\/tbody>\n<\/table>\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<\/p>\n<p>\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<\/p>\n<p>\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<\/p>\n<p>\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\uff1a<\/p>\n<p><a href=\"http:\/\/www.menglanglang.cn\/wp-content\/uploads\/2019\/07\/encoded.png\"><img loading=\"lazy\" decoding=\"async\" class=\"size-full wp-image-3168 alignnone\" src=\"http:\/\/www.menglanglang.cn\/wp-content\/uploads\/2019\/07\/encoded.png\" alt=\"\" width=\"307\" height=\"278\" srcset=\"http:\/\/www.menglanglang.cn\/wp-content\/uploads\/2019\/07\/encoded.png 307w, http:\/\/www.menglanglang.cn\/wp-content\/uploads\/2019\/07\/encoded-300x272.png 300w\" sizes=\"auto, (max-width: 307px) 100vw, 307px\" \/><\/a><\/p>\n<p>\u6d4f\u89c8\u7f51\u9875\u7684\u65f6\u5019\uff0c\u670d\u52a1\u5668\u4f1a\u628a\u52a8\u6001\u751f\u6210\u7684Unicode\u5185\u5bb9\u8f6c\u6362\u4e3aUTF-8\u518d\u4f20\u8f93\u5230\u6d4f\u89c8\u5668\uff1a<\/p>\n<p><a href=\"http:\/\/www.menglanglang.cn\/wp-content\/uploads\/2019\/07\/encoded2.png\"><img loading=\"lazy\" decoding=\"async\" class=\"size-full wp-image-3170 alignnone\" src=\"http:\/\/www.menglanglang.cn\/wp-content\/uploads\/2019\/07\/encoded2.png\" alt=\"\" width=\"302\" height=\"266\" srcset=\"http:\/\/www.menglanglang.cn\/wp-content\/uploads\/2019\/07\/encoded2.png 302w, http:\/\/www.menglanglang.cn\/wp-content\/uploads\/2019\/07\/encoded2-300x264.png 300w\" sizes=\"auto, (max-width: 302px) 100vw, 302px\" \/><\/a><\/p>\n<p>\u6240\u4ee5\u4f60\u770b\u5230\u5f88\u591a\u7f51\u9875\u7684\u6e90\u7801\u4e0a\u4f1a\u6709\u7c7b\u4f3c<code>&lt;meta charset=\"UTF-8\" \/&gt;<\/code>\u7684\u4fe1\u606f\uff0c\u8868\u793a\u8be5\u7f51\u9875\u6b63\u662f\u7528\u7684UTF-8\u7f16\u7801\u3002<\/p>\n","protected":false},"excerpt":{"rendered":"<p>\u5b57\u7b26\u4e32\u6bd4\u8f83\u7279\u6b8a\u7684\u662f\u8fd8\u6709\u4e00\u4e2a\u7f16\u7801\u95ee\u9898\u3002 \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 [&hellip;]<\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[313],"tags":[298,452,299,315],"class_list":["post-3157","post","type-post","status-publish","format-standard","hentry","category-it-knowledge","tag-utf-8","tag-452","tag-299","tag-315"],"_links":{"self":[{"href":"http:\/\/www.menglanglang.cn\/index.php?rest_route=\/wp\/v2\/posts\/3157","targetHints":{"allow":["GET"]}}],"collection":[{"href":"http:\/\/www.menglanglang.cn\/index.php?rest_route=\/wp\/v2\/posts"}],"about":[{"href":"http:\/\/www.menglanglang.cn\/index.php?rest_route=\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"http:\/\/www.menglanglang.cn\/index.php?rest_route=\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"http:\/\/www.menglanglang.cn\/index.php?rest_route=%2Fwp%2Fv2%2Fcomments&post=3157"}],"version-history":[{"count":4,"href":"http:\/\/www.menglanglang.cn\/index.php?rest_route=\/wp\/v2\/posts\/3157\/revisions"}],"predecessor-version":[{"id":3765,"href":"http:\/\/www.menglanglang.cn\/index.php?rest_route=\/wp\/v2\/posts\/3157\/revisions\/3765"}],"wp:attachment":[{"href":"http:\/\/www.menglanglang.cn\/index.php?rest_route=%2Fwp%2Fv2%2Fmedia&parent=3157"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"http:\/\/www.menglanglang.cn\/index.php?rest_route=%2Fwp%2Fv2%2Fcategories&post=3157"},{"taxonomy":"post_tag","embeddable":true,"href":"http:\/\/www.menglanglang.cn\/index.php?rest_route=%2Fwp%2Fv2%2Ftags&post=3157"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}