{"id":148,"date":"2021-02-03T13:43:12","date_gmt":"2021-02-03T05:43:12","guid":{"rendered":"https:\/\/blog.cruciferslab.net\/?p=148"},"modified":"2025-05-13T21:42:30","modified_gmt":"2025-05-13T13:42:30","slug":"%e6%96%87%e5%ad%97%e7%b7%a8%e7%a2%bc%e9%9b%9c%e8%ab%87-2","status":"publish","type":"post","link":"https:\/\/blog.cruciferslab.net\/?p=148","title":{"rendered":"\u6587\u5b57\u7de8\u78bc\u96dc\u8ac7 (2)"},"content":{"rendered":"\n<p>\u7cfb\u5217\u6587\u7ae0\u7684\u7b2c\u4e8c\u7bc7\uff0c\u5c31\u4f86\u7c21\u55ae\u8ac7\u8ac7\u6240\u8b02\u7684\u300c\u4e82\u78bc\u300d\u5427\u3002<\/p>\n\n\n\n<h2 class=\"wp-block-heading\">\u4e82\u78bc\u8207\u4ed6\u5011\u7684\u7522\u5730<\/h2>\n\n\n\n<p>\u9019\u7bc0\u7684\u6a19\u984c\u662f<a href=\"https:\/\/www.facebook.com\/Nerdxplain\/posts\/826041008220006\" data-type=\"URL\" data-id=\"https:\/\/www.facebook.com\/Nerdxplain\/posts\/826041008220006\">\u4e00\u7bc7 Facebook \u8f49\u8cbc\u6587<\/a>\u7684\u52a0\u8a3b\uff0c\u6700\u539f\u59cb\u7684\u51fa\u8655\u5247\u662f<a href=\"https:\/\/twitter.com\/Linmiv\/status\/1336573220665737216\" data-type=\"URL\" data-id=\"https:\/\/twitter.com\/Linmiv\/status\/1336573220665737216\">\u4e00\u500b\u4e2d\u570b\u4eba\u7684\u63a8\u7279<\/a>\u3002\u96d6\u7136\u90a3\u500b\u8868\u683c\u662f\u4ee5 GBK \u7de8\u78bc\u70ba\u4e3b\uff0c\u4f46\u9664\u4e86\u600e\u9ebc\u89e3\u8b80\u4e82\u78bc\u4e4b\u5916\uff0c\u5176\u5be6\u9084\u6709\u4e00\u500b\u5f88\u91cd\u8981\u7684\u8a0a\u606f\u5728\u88e1\u9762\u3002<\/p>\n\n\n\n<!--more-->\n\n\n\n<p>\u4ec0\u9ebc\u6a23\u7684\u8a0a\u606f\uff1f\u6211\u518d\u6b21\u5f15\u5468\u601d\u535a\u7684\u6587\u7ae0\u88e1\u7684\u4e00\u6bb5\u4f86\u8aaa\u660e\u5427\uff1a<\/p>\n\n\n\n<blockquote class=\"wp-block-quote is-layout-flow wp-block-quote-is-layout-flow\">\n<p>\u7576PC\u958b\u59cb\u8ce3\u5230\u7f8e\u570b\u4ee5\u5916\u6642\uff0c\u5404\u7a2e\u4e0d\u540c\u7684OEM\u5b57\u5143\u5c31\u88ab\u6191\u7a7a\u5275\u9020\u51fa\u4f86\uff0c\u5927\u5bb6\u90fd\u628a\u4e0a\u9762\u9019128\u500b\u5b57\u5143\u62ff\u4f86\u81ea\u5df1\u7528\u3002\u8209\u4f8b\u4f86\u8aaa\uff0c\u5b57\u5143\u78bc130\u5728\u67d0\u4e9bPC\u4e0a\u6703\u986f\u793a\u70ba\u00e9\uff0c\u4e0d\u904e\u5728\u4ee5\u8272\u5217\u8ce3\u7684\u96fb\u8166\u4e0a\u5c31\u8b8a\u6210\u5e0c\u4f2f\u4f86\u6587\u5b57\u6bcdGimel (\u05d2)\uff0c\u6240\u4ee5\u7576\u7f8e\u570b\u4eba\u628a\u5c65\u6b77(r\u00e9sum\u00e9)\u5bc4\u5230\u4ee5\u8272\u5217\u5c31\u6703\u8b8a\u6210r<strong>\u05d2<\/strong>sum<strong>\u05d2<\/strong>\u3002<\/p>\n<\/blockquote>\n\n\n\n<p>\u4ed6\u7684\u9019\u500b\u4f8b\u5b50\u6240\u8981\u8868\u9054\u7684\u5c31\u662f\uff1a\u540c\u6a23\u662f 130 \u9019\u500b\u78bc\uff0c\u5728\u4e0d\u540c\u7684\u96fb\u8166\u4e0a\u7528\u4e0d\u540c\u7684\u5b57\u5143\u96c6\u89e3\u91cb\u5c31\u6703\u986f\u793a\u51fa\u4e0d\u540c\u7684\u5b57\u51fa\u4f86\u3002DBCS \u7de8\u78bc\u4e5f\u662f\u4e00\u6a23\uff0c\u4e00\u500b\u5b57\u5143\u96c6\u8868\u793a\u7684\u5b57\u4e32\u7528\u53e6\u4e00\u500b\u5b57\u5143\u96c6\u4f86\u89e3\u91cb\u5c31\u6703\u51fa\u73fe\u5947\u602a\u7684\u8868\u793a\u3002\u9019\u4e00\u9ede\u5728\u6700\u958b\u59cb\u6587\u7ae0\u7684\u8868\u683c\u88e1\u662f\u4ee5\u6700\u53f3\u6b04\u7684\u7522\u751f\u539f\u56e0\u4f86\u8868\u793a\uff0c\u53ef\u4ee5\u770b\u5230\u8868\u4e2d\u7684\u72c0\u6cc1\u90fd\u662f\u56e0\u70ba\u7528\u4e86\u932f\u8aa4\u7684\u5b57\u5143\u96c6\u4f86\u89e3\u91cb\u5b57\u4e32\u7684\u95dc\u4fc2\u3002\u9019\u5c31\u662f\u6211\u6240\u8aaa\u7684\u91cd\u8981\u8a0a\u606f\uff1a<\/p>\n\n\n\n<p class=\"has-text-align-center\"><strong>\u4e82\u78bc\u7684\u7522\u751f\u90fd\u662f\u56e0\u70ba\u7528\u932f\u8aa4\u7684\u65b9\u5f0f\u53bb\u89e3\u8b80\u61c9\u8a72\u7528\u67d0\u7a2e\u65b9\u5f0f\u89e3\u8b80\u7684\u4f4d\u5143\u7d44\u7684\u95dc\u4fc2\u3002<\/strong><\/p>\n\n\n\n<p>\u4e00\u500b\u984c\u5916\u8a71\uff1a\u6211\u5011\u7a31\u505a\u300c\u4e82\u78bc\u300d\u7684\u9019\u500b\u73fe\u8c61\uff0c\u5728\u4e16\u754c\u7684\u5176\u4ed6\u5730\u65b9\u662f\u7528\u4e00\u500b\u65e5\u6587\u8a5e\u7a31\u547c\uff1a<a href=\"https:\/\/en.wikipedia.org\/wiki\/Mojibake\" data-type=\"URL\" data-id=\"https:\/\/en.wikipedia.org\/wiki\/Mojibake\">Mojibake<\/a>\u300c\u6587\u5b57\u5316\u3051\u300d\uff0c\u76f4\u8b6f\u662f\u300c\u6587\u5b57\u7522\u751f\u8b8a\u5316\u300d\uff0c\u4e0d\u904e\u9019\u88e1\u7684\u300c\u5316\u3051\u300d\u66f4\u5e36\u6709\u985e\u4f3c\u65bc\u5996\u602a\u8b8a\u5f62\u7684\u610f\u601d\u5728\u5167 (\u50cf\u662f\u300c\u5316\u3051\u732b\u300d\u7684\u300c\u5316\u3051\u300d)\u3002\u6216\u8a31\u662f\u56e0\u70ba\u65e5\u6587\u74b0\u5883\u5728 Unicode \u4e4b\u524d\u66fe\u7d93\u6709\u5169\u5957\u76f8\u5c0d\u6d41\u884c\u7684 DBCS \u7de8\u78bc\u7684\u95dc\u4fc2\u5427\uff0c\u9019\u7a2e\u4e82\u78bc\u73fe\u8c61\u5728\u65e5\u6587\u74b0\u5883\u4e4b\u5167\u5c31\u5df2\u7d93\u5f88\u5e38\u898b\u4e86\uff0c\u4e0d\u9700\u8981\u5230\u8de8\u8a9e\u8a00\u4ea4\u63db\u624d\u6703\u51fa\u73fe\u3002<\/p>\n\n\n\n<p>\u8aaa\u5230\u65e5\u6587\u7de8\u78bc\uff0c\u5982\u679c\u66fe\u7d93\u5728 200x \u5e74\u5de6\u53f3\u5728\u7db2\u8def\u4e0a\u4e0b\u8f09\u904e\u6771\u897f\u7684\u4eba\u4e00\u5b9a\u9047\u904e\u5f88\u591a\u65e5\u672c\u88fd\u904a\u6232\u7684\u58d3\u7e2e\u6a94\uff0c\u8981\u7528\u65e5\u6587\u5730\u5340\u8a2d\u5b9a\u958b\u555f\u89e3\u58d3\u7e2e\u7a0b\u5f0f\u624d\u4e0d\u6703\u767c\u751f\u6a94\u540d\u4e82\u78bc\uff0c\u7136\u5f8c\u57f7\u884c\u6642\u4e5f\u9700\u8981\u7528\u65e5\u6587\u5730\u5340\u8a2d\u5b9a\u958b\u555f\uff0c\u904a\u6232\u5167\u7684\u6587\u5b57\u624d\u6703\u6b63\u5e38\u3002\u6703\u9700\u8981\u9019\u9ebc\u505a\u7684\u539f\u56e0\u5c31\u662f\uff1a\u904a\u6232\u672c\u8eab\u662f\u5728\u65e5\u6587\u74b0\u5883\u88fd\u4f5c\u7684\uff0c\u4f46\u537b\u6c92\u6709\u8003\u616e\u5230\u7de8\u78bc\u554f\u984c\uff0c\u6240\u4ee5\u904a\u6232\u5167\u7684\u6587\u5b57\u53ca\u5b58\u53d6\u6a94\u6848\u7684\u6a94\u540d\u90fd\u662f\u4ee5\u65e5\u6587\u7de8\u78bc\u5132\u5b58\uff0c\u4e5f\u9810\u8a2d\u7cfb\u7d71\u6703\u7528\u65e5\u6587\u7de8\u78bc\u53bb\u89e3\u8b80\uff1b\u9019\u6a23\u7684\u904a\u6232\u62ff\u5230\u5225\u7684\u7cfb\u7d71\u4e0a\u6642\uff0c\u7576\u7cfb\u7d71\u4e0d\u662f\u7528\u65e5\u6587\u7de8\u78bc\u89e3\u8b80\u6642\u5c31\u6703\u9020\u6210\u4e82\u78bc\u4e86\u3002<\/p>\n\n\n\n<p>\u58d3\u7e2e\u6a94\u7684\u72c0\u6cc1\u4e5f\u662f\u985e\u4f3c\u7684\uff0c\u4f46\u9019\u500b\u72c0\u6cc1\u9084\u66f4\u9ebb\u7169\uff1a\u73fe\u5728\u6d41\u884c\u7684\u58d3\u7e2e\u6a94\u683c\u5f0f\u6700\u521d\u5236\u5b9a\u7684\u6642\u9593\u90fd\u662f\u5728 Unicode \u666e\u53ca\u4e4b\u524d\uff0c\u56e0\u6b64\u5c0d\u65bc\u6a94\u6848\u540d\u7a31\u7684\u7de8\u78bc\u5168\u90e8\u90fd\u5047\u5b9a\u662f\u7cfb\u7d71\u7de8\u78bc\uff0c\u6240\u4ee5\u5c31\u6703\u767c\u751f\u548c\u4e0a\u4e00\u6bb5\u4e00\u6a23\u7684\u554f\u984c\u3002\u9019\u5373\u662f\u4f7f\u7528\u65e5\u6587\u5730\u5340\u8a2d\u5b9a\u958b\u555f\u89e3\u58d3\u7e2e\u7a0b\u5f0f\u624d\u80fd\u6b63\u78ba\u89e3\u8b80\u7684\u539f\u56e0\u4e86\u3002\u9019\u500b\u72c0\u6cc1\u5728\u5404\u5927\u58d3\u7e2e\u6a94\u6848\u683c\u5f0f\u958b\u59cb\u652f\u63f4 Unicode \u4e4b\u5f8c\u5c31\u6162\u6162\u6d88\u5931\uff0c\u6240\u4ee5\u73fe\u5728\u5927\u6982\u53ea\u6709\u7576\u5e74\u7559\u4e0b\u4f86\u7684\u6a94\u6848\u624d\u6709\u53ef\u80fd\u9084\u6709\u9019\u7a2e\u554f\u984c\u5427\u3002<\/p>\n\n\n\n<h2 class=\"wp-block-heading\">\u3042\u3044\u3046\u3048\u304a\u7709\u5e45<\/h2>\n\n\n\n<p>\u4e0a\u4e00\u7bc7\u6587\u7ae0\u9664\u4e86\u4ecb\u7d39 DBCS \u4e4b\u5916\uff0c\u6709\u4e00\u90e8\u4efd\u5176\u5be6\u662f\u5728\u89e3\u91cb\u6211\u7576\u5e74\u7a76\u7adf\u662f\u600e\u9ebc\u731c\u5230\u90a3\u500b\u7de8\u78bc\u7684\u3002\u4e0d\u904e\u731c\u662f\u4e00\u56de\u4e8b\uff0c\u9a57\u8b49\u5b83\u662f\u4e0d\u662f\u53c8\u662f\u53e6\u4e00\u56de\u4e8b\uff0c\u7562\u7adf\u6211\u5011\u4eba\u53ef\u4ee5\u8a66\u4e0b\u53bb\u4e4b\u5f8c\u53bb\u300c\u770b\u770b\u300d\u7a76\u7adf\u9019\u500b\u8a66\u8d77\u4f86\u5c0d\u4e0d\u5c0d\uff0c\u51fa\u73fe\u7684\u7d50\u679c\u662f\u4e0d\u662f\u5c0d\u6211\u5011\u6709\u610f\u7fa9\uff0d\uff0d\u6211\u5728\u5617\u8a66\u90a3\u5169\u7a2e\u7de8\u78bc\u770b\u5230\u516b\u500b\u4e00\u6a23\u7684\u5b57\u6642\u4e5f\u6ce8\u610f\u5230\u4e86\u5b83\u5011\u4e4b\u9593\u4f3c\u4e4e\u662f\u53ef\u4ee5\u9023\u6210\u8a5e\u7684\uff1a\u9023\u7e8c\u7684\u5169\u500b\u6578\u5b57\u89e3\u51fa\u4f86\u7684\u5b57\u53ef\u4ee5\u9023\u6210\u300c\u6416\u982d\u300d\u3001\u300c\u8f5f\u52d5\u300d\u9019\u6a23\u7684\u8a5e\uff0c\u66f4\u78ba\u8a8d\u4e86\u9019\u5f88\u5927\u6a5f\u7387\u5c31\u662f\u9019\u4e9b\u6578\u5b57\u7684\u89e3\u91cb\u65b9\u6cd5\u3002<\/p>\n\n\n\n<p>\u4f46\u82e5\u8981\u70ba\u6a5f\u5668\u7684\u5224\u65b7\u6f14\u7b97\u6cd5\u52a0\u5165\u9019\u65b9\u9762\u7684\u8cc7\u8a0a\uff0c\u5f97\u8981\u5230\u4e86\u8fd1\u5e74 AI \u9818\u57df\u8208\u8d77\u624d\u6bd4\u8f03\u6709\u53ef\u80fd\u9054\u6210\uff1b\u4e8c\u5341\u5e74\u524d\u53ef\u6c92\u6709\u985e\u795e\u7d93\u7db2\u8def\u53ef\u4ee5\u8b93\u6a5f\u5668\u5224\u65b7\u9019\u89e3\u78bc\u51fa\u4f86\u5408\u4e0d\u5408\u7406\uff0c\u6240\u4ee5\u53ea\u80fd\u9000\u800c\u6c42\u5176\u6b21\uff0c\u5229\u7528\u50b3\u7d71\u5bc6\u78bc\u5b78\u7684\u983b\u7387\u5206\u6790\u4f86\u5e6b\u52a9\u5224\u65b7\u3002\u5468\u601d\u535a\u63d0\u904e\u700f\u89bd\u5668\u6703\u70ba\u6c92\u6709\u6307\u5b9a\u7de8\u78bc\u7684\u7db2\u9801\u731c\u4e00\u500b\u7de8\u78bc\uff0c\u9019\u500b\u5224\u65b7\u73fe\u5728\u7684\u700f\u89bd\u5668\u88e1\u4f9d\u7136\u5b58\u5728\uff0c\u53ea\u662f\u8907\u96dc\u8a31\u591a\uff1a\u4f8b\u5982 Google Chrome \u66fe\u7d93\u4f7f\u7528\u904e <a href=\"http:\/\/site.icu-project.org\/home\" data-type=\"URL\" data-id=\"http:\/\/site.icu-project.org\/home\">ICU \u51fd\u5f0f\u5eab<\/a>\u4e2d\u7684\u7de8\u78bc\u731c\u6e2c\u529f\u80fd\uff0c\u5f8c\u4f86\u6539\u7528 Google \u81ea\u5bb6\u7684 <a href=\"https:\/\/opensource.google\/projects\/ced\">Compact Encoding Detector<\/a> \u51fd\u5f0f\u5eab\u3002\u9019\u7a2e\u983b\u7387\u5206\u6790\u7531\u65bc\u65b9\u6cd5\u672c\u8eab\u7279\u6027\u7684\u95dc\u4fc2\u5e7e\u4e4e\u7121\u6cd5\u5c0d\u592a\u77ed\u7684\u5b57\u4e32\u4f7f\u7528\uff0c\u56e0\u6b64\u5e38\u5e38\u56e0\u70ba\u9019\u500b\u5224\u5b9a\u904e\u7a0b\u731c\u932f\u7de8\u78bc\uff0c\u800c\u4f7f\u5f97\u6587\u5b57\u88ab\u932f\u8aa4\u7684\u7de8\u78bc\u89e3\u8b80\u9020\u6210\u4e82\u78bc\u3002<\/p>\n\n\n\n<p>\u4e0a\u9762\u63d0\u5230\u65e5\u6587\u74b0\u5883\u6709\u8457\u5169\u5957\u5e38\u898b\u7684 DBCS \u7de8\u78bc (EUC-JP \u548c Shift-JIS)\uff0c\u6240\u4ee5\u9019\u7a2e\u554f\u984c\u5728\u65e5\u6587\u74b0\u5883\u751a\u81f3\u4e0d\u53ea\u5728\u700f\u89bd\u5668\u4e0a\u5b58\u5728\uff0c\u9084\u5305\u542b\u5f8c\u7aef\u8655\u7406\u7684\u7a0b\u5f0f\u4e5f\u6703\u767c\u751f\u3002\u6211\u66fe\u7d93\u5728\u4e00\u4e9b\u65e5\u672c\u88fd\u7684\u7db2\u9801\u88e1\u770b\u5230\u904e\u4e00\u4e9b\u8868\u55ae\u4e2d\u6709\u8457\u795e\u79d8\u7684\u96b1\u85cf\u6b04\u4f4d\u5beb\u8457\u4f8b\u5982\u300c\u3042\u3044\u3046\u3048\u304a\u7709\u5e45\u300d\u6216\u300c\u7f8e\u4e73\u300d\u4e4b\u985e\u7684\u503c\uff0c\u539f\u672c\u4ee5\u70ba\u662f\u67d0\u7a2e\u8868\u55ae\u5b8c\u6574\u6027\u6aa2\u67e5\u7684\uff0c\u5f8c\u4f86\u53bb\u627e\u4e86\u8cc7\u6599<sup data-fn=\"b7943b30-bb5c-4503-aa93-cd7171dd8ef4\" class=\"fn\"><a href=\"#b7943b30-bb5c-4503-aa93-cd7171dd8ef4\" id=\"b7943b30-bb5c-4503-aa93-cd7171dd8ef4-link\">1<\/a><\/sup>\u624d\u77e5\u9053\uff1a\u9019\u662f\u70ba\u4e86\u8b93\u5f8c\u7aef\u7a0b\u5f0f\u4e0d\u8981\u628a\u6240\u9001\u51fa\u7684\u8868\u55ae\u6587\u5b57\u5224\u65b7\u70ba Shift-JIS \u7de8\u78bc\u7528\u7684\uff1b\u7576\u51fa\u73fe\u9019\u7a2e\u72c0\u6cc1\u6642\uff0c\u539f\u672c\u662f EUC-JP \u7684\u5b57\u88ab\u5f8c\u7aef\u7576\u6210 Shift-JIS \u8655\u7406\uff0c\u8655\u7406\u5b8c\u518d\u9001\u56de\u7db2\u9801\u6642\uff0c\u53c8\u518d\u4ee5 EUC-JP \u89e3\u91cb\u5f8c\u7aef\u9001\u51fa\u4f86\u7684\u6771\u897f\uff0c\u5c31\u9020\u6210\u4e82\u78bc\u4e86\u3002<\/p>\n\n\n\n<p>\u4f7f\u7528\u9019\u4e9b\u5b57\u80fd\u89e3\u6c7a\u9019\u500b\u554f\u984c\u7684\u539f\u56e0\u5c31\u662f\uff0c\u5b83\u5011\u7684 EUC-JP \u7de8\u78bc\u88e1\u90fd\u6703\u6709\u4e00\u822c Shift-JIS \u4e0d\u6703\u51fa\u73fe\u7684\u4f4d\u5143\u7d44\u7d44\u5408 (\u300c\u3042\u3044\u3046\u3048\u304a\u300d\u7684\u9996\u4f4d\u5143\u7d44\u662f 0xA4\uff0c\u300c\u7709\u5e45\u300d\u5169\u5b57\u7684\u672b\u4f4d\u5143\u7d44\u662f 0xFD\uff0c\u300c\u7f8e\u4e73\u300d\u5169\u5b57\u5247\u5206\u5225\u6709 0xFE \u548c 0xFD)\uff0c\u56e0\u6b64\u5f8c\u7aef\u7a0b\u5f0f\u4fbf\u4e0d\u6703\u5c07\u8868\u55ae\u6587\u5b57\u5224\u65b7\u70ba Shift-JIS \u800c\u662f\u6b63\u78ba\u7684 EUC-JP \u4e86\u3002<\/p>\n\n\n\n<h2 class=\"wp-block-heading\">IsTextUnicode<\/h2>\n\n\n\n<p>\u540c\u6a23\u7684\u554f\u984c\u5728 Unicode \u4e0a\u4e5f\u662f\u5b58\u5728\u7684\u3002Unicode \u6700\u4e00\u958b\u59cb\u7684\u76ee\u6a19\u78ba\u5be6\u662f\u70ba\u4e86\u8981\u5b9a\u4e00\u500b\u6a19\u6e96\u4f7f\u9019\u4e16\u754c\u4e0a\u5404\u500b\u8a9e\u8a00\u7684\u4f7f\u7528\u8005\u90fd\u80fd\u6709\u4e00\u5957\u7d71\u4e00\u7684\u7de8\u78bc\u80fd\u5920\u4f7f\u7528\uff0c\u4f46\u5c31\u5982\u540c\u5468\u601d\u535a\u7684\u6587\u7ae0\u5f8c\u534a\u6240\u63d0\u5230\u7684\uff0cUnicode \u7684 code point \u548c\u5b83\u5011\u600e\u9ebc\u8f49\u63db\u6210\u4f4d\u5143\u7d44\u5132\u5b58\u662f\u5169\u56de\u4e8b\uff0c\u4e5f\u5c31\u662f\u8aaa\u6211\u5011\u53c8\u6709\u4e86\u53e6\u5916\u5f88\u591a\u7a2e\u4f4d\u5143\u7d44\u7684\u89e3\u91cb\u6cd5\uff0c\u800c\u5b83\u5011\u548c\u539f\u672c\u65e2\u5b58\u7684\u7de8\u78bc\u4e4b\u9593\u53ef\u4ee5\u4e0d\u76f8\u5bb9\uff0d\uff0d\u9019\u5c31\u6703\u51fa\u73fe\u50cf\u4e0a\u4e00\u7bc7\u88e1\u6211\u63d0\u904e\u7684\u90a3\u500b\u662f <code data-enlighter-language=\"raw\" class=\"EnlighterJSRAW\">AA<\/code> \u9084\u662f\u4e2d\u6587\u5b57\u7684\u5224\u65b7\u554f\u984c\u4e86\u3002<\/p>\n\n\n\n<p>\u82f1\u6587\u7dad\u57fa\u767e\u79d1\u88e1\u6709\u9019\u9ebc\u4e00\u500b\u8a5e\u689d\u53eb <a href=\"https:\/\/en.wikipedia.org\/wiki\/Bush_hid_the_facts\" data-type=\"URL\" data-id=\"https:\/\/en.wikipedia.org\/wiki\/Bush_hid_the_facts\">Bush hid the facts<\/a>\uff0c\u8b1b\u7684\u4e26\u4e0d\u662f\u4ec0\u9ebc\u5e03\u5e0c\u85cf\u4e86\u4ec0\u9ebc\u4e8b\u5be6\u7684\u9670\u8b00\u8ad6\uff0c\u800c\u662f Windows \u5230 XP \u70ba\u6b62\u7684\u5167\u5efa\u8a18\u4e8b\u672c\u7684\u4e00\u500b\u7de8\u78bc\u5224\u65b7\u932f\u8aa4\uff1a\u7576\u4f60\u5c07\u9019\u53e5\u8a71\u4e00\u5171\u5341\u516b\u500b\u534a\u5f62\u5b57 (\u4e0d\u52a0\u53e5\u9ede\u63db\u884c) \u6253\u5165\u4e00\u500b\u65b0\u8a18\u4e8b\u672c\uff0c\u5132\u5b58\u95dc\u9589\u518d\u958b\u555f\u6642\uff0c\u5b83\u6703\u986f\u793a\u6210\u4e5d\u500b\u6f22\u5b57\uff1a\u300c<a href=\"https:\/\/zh.wiktionary.org\/wiki\/%E7%95%82\" data-type=\"URL\" data-id=\"https:\/\/zh.wiktionary.org\/wiki\/%E7%95%82\">\u7542<\/a><a href=\"https:\/\/zh.wiktionary.org\/wiki\/%E6%A1%B3\" data-type=\"URL\" data-id=\"https:\/\/zh.wiktionary.org\/wiki\/%E6%A1%B3\">\u6873<\/a><a href=\"https:\/\/zh.wiktionary.org\/wiki\/%E6%A0%A0\" data-type=\"URL\" data-id=\"https:\/\/zh.wiktionary.org\/wiki\/%E6%A0%A0\">\u6820<\/a><a href=\"https:\/\/zh.wiktionary.org\/wiki\/%E6%91%A9\" data-type=\"URL\" data-id=\"https:\/\/zh.wiktionary.org\/wiki\/%E6%91%A9\">\u6469<\/a><a href=\"https:\/\/zh.wiktionary.org\/wiki\/%E7%90%A0\" data-type=\"URL\" data-id=\"https:\/\/zh.wiktionary.org\/wiki\/%E7%90%A0\">\u7420<\/a><a href=\"https:\/\/zh.wiktionary.org\/wiki\/%E6%95%A8\" data-type=\"URL\" data-id=\"https:\/\/zh.wiktionary.org\/wiki\/%E6%95%A8\">\u6568<\/a><a href=\"https:\/\/zh.wiktionary.org\/wiki\/%E6%98%A0\" data-type=\"URL\" data-id=\"https:\/\/zh.wiktionary.org\/wiki\/%E6%98%A0\">\u6620<\/a><a href=\"https:\/\/zh.wiktionary.org\/wiki\/%E6%8D%A1\" data-type=\"URL\" data-id=\"https:\/\/zh.wiktionary.org\/wiki\/%E6%8D%A1\">\u6361<\/a><a href=\"https:\/\/zh.wiktionary.org\/wiki\/%E7%8D%B4\" data-type=\"URL\" data-id=\"https:\/\/zh.wiktionary.org\/wiki\/%E7%8D%B4\">\u7374<\/a>\u300d\u3002\u9019\u662f\u56e0\u70ba\uff0c\u8a18\u4e8b\u672c\u5167\u90e8\u662f\u4f7f\u7528\u4e00\u500b Windows API \u51fd\u6578\u53eb <a href=\"https:\/\/docs.microsoft.com\/en-us\/windows\/win32\/api\/winbase\/nf-winbase-istextunicode\" data-type=\"URL\" data-id=\"https:\/\/docs.microsoft.com\/en-us\/windows\/win32\/api\/winbase\/nf-winbase-istextunicode\">IsTextUnicode<\/a> \u4f86\u731c\u731c\u770b\u7d66\u5b9a\u7684\u9019\u4e32\u4f4d\u5143\u7d44\u6709\u6c92\u6709\u53ef\u80fd\u662f Unicode\uff0c\u800c\u9019\u5341\u516b\u500b\u4f4d\u5143\u7d44\u7684\u7d44\u5408\u82e5\u89e3\u91cb\u505a UTF-16 Little Endian \u6642\uff0c\u5168\u90e8\u90fd\u8b8a\u6210\u4e86\u4e2d\u6587\u5b57\uff1a<\/p>\n\n\n\n<figure class=\"wp-block-image size-large\"><img loading=\"lazy\" decoding=\"async\" width=\"838\" height=\"89\" src=\"https:\/\/blog.cruciferslab.net\/wp-content\/uploads\/2021\/01\/image.png\" alt=\"\" class=\"wp-image-157\" srcset=\"https:\/\/blog.cruciferslab.net\/wp-content\/uploads\/2021\/01\/image.png 838w, https:\/\/blog.cruciferslab.net\/wp-content\/uploads\/2021\/01\/image-300x32.png 300w, https:\/\/blog.cruciferslab.net\/wp-content\/uploads\/2021\/01\/image-150x16.png 150w, https:\/\/blog.cruciferslab.net\/wp-content\/uploads\/2021\/01\/image-768x82.png 768w\" sizes=\"auto, (max-width: 838px) 100vw, 838px\" \/><\/figure>\n\n\n\n<p>\u9019\u5c31\u4f7f\u5f97 IsTextUnicode \u5224\u65b7\u300c\u9019\u770b\u8d77\u4f86\u50cf\u4e2d\u6587\uff0c\u6240\u4ee5\u5b83\u61c9\u8a72\u662f UTF16-LE\u300d\uff0c\u800c\u8a18\u4e8b\u672c\u7167\u5be6\u5448\u73fe\u51fa\u4f86\u800c\u5df2\u3002\u9019\u4e26\u4e0d\u53ea\u6709\u770b\u8d77\u4f86\u50cf\u4e2d\u6587\u7684\u72c0\u6cc1\u6703\u767c\u751f\uff1a\u6211\u5728 PTT \u4e0a\u5c31\u770b\u904e\u5169\u6b21\u540c\u6a23\u9019\u4e00\u500b\u554f\u984c\u51fa\u73fe\u904e\uff0c\u7b2c\u4e00\u500b (<a href=\"http:\/\/www.ptt.cc\/bbs\/Programming\/M.1195468061.A.EB8.html\" data-type=\"URL\" data-id=\"http:\/\/www.ptt.cc\/bbs\/Programming\/M.1195468061.A.EB8.html\">\u767c\u554f\u8005<\/a>\u3001<a href=\"http:\/\/www.ptt.cc\/bbs\/Programming\/M.1195561713.A.E8D.html\" data-type=\"URL\" data-id=\"http:\/\/www.ptt.cc\/bbs\/Programming\/M.1195561713.A.E8D.html\">\u56de\u61c9<\/a>\u3001<a href=\"http:\/\/www.ptt.cc\/bbs\/Programming\/M.1195573012.A.642.html\" data-type=\"URL\" data-id=\"http:\/\/www.ptt.cc\/bbs\/Programming\/M.1195573012.A.642.html\">\u6211\u7684\u56de\u61c9<\/a>) \u5224\u65b7\u6210\u4e86\u5370\u5ea6\u6587\uff0c\u7b2c\u4e8c\u500b (<a href=\"http:\/\/www.ptt.cc\/bbs\/C_and_CPP\/M.1292174190.A.55B.html\" data-type=\"URL\" data-id=\"http:\/\/www.ptt.cc\/bbs\/C_and_CPP\/M.1292174190.A.55B.html\">\u767c\u554f\u8005<\/a>\u3001<a href=\"http:\/\/www.ptt.cc\/bbs\/C_and_CPP\/M.1292223194.A.0E3.html\" data-type=\"URL\" data-id=\"http:\/\/www.ptt.cc\/bbs\/C_and_CPP\/M.1292223194.A.0E3.html\">\u6211\u7684\u56de\u61c9<\/a>) \u5224\u65b7\u6210\u4e86\u5343\u5206\u6bd4\u548c\u842c\u5206\u6bd4\u7b26\u865f\u3002<sup data-fn=\"d8f9cce6-0520-40ff-b8d0-812798543380\" class=\"fn\"><a href=\"#d8f9cce6-0520-40ff-b8d0-812798543380\" id=\"d8f9cce6-0520-40ff-b8d0-812798543380-link\">2<\/a><\/sup><\/p>\n\n\n\n<h2 class=\"wp-block-heading\">BOM<\/h2>\n\n\n\n<p>\u9019\u4e5f\u5c31\u662f\u70ba\u4ec0\u9ebc\uff0c\u5468\u601d\u535a\u7684\u6587\u7ae0\u5f8c\u534a\u6bb5\u6703\u7528\u90a3\u9ebc\u9577\u4e00\u6bb5\u7bc7\u5e45\u4ecb\u7d39 Unicode \u7684\u57fa\u672c\u89c0\u5ff5\u4ee5\u53ca\u7a0b\u5f0f\u8a2d\u8a08\u8005\u8981\u7528\u4ec0\u9ebc\u65b9\u5f0f\u53bb\u6b63\u78ba\u6a19\u8a18\u4f60\u7684\u6587\u5b57\u7de8\u78bc\uff1b\u9023\u6982\u5ff5\u4e0a\u53ea\u6709\u6587\u5b57\u7684\u300c\u7d14\u6587\u5b57\u6a94\u6848\u300d\u90fd\u8981\u585e\u4e00\u500b\u53eb\u505a BOM \u7684\u6771\u897f\u53bb\u8aaa\u300c\u6211\u9019\u6587\u5b57\u662f\u4f7f\u7528\u9019\u7a2e Unicode \u7de8\u78bc\u5132\u5b58\u7684\u300d\uff0c\u5426\u5247\uff1a<\/p>\n\n\n\n<blockquote class=\"wp-block-quote is-layout-flow wp-block-quote-is-layout-flow\">\n<p>\u7b49\u5230\u67d0\u4e00\u5929\uff0c\u7576\u4ed6\u5011\u5beb\u7684\u5167\u5bb9\u4e0d\u7b26\u5408\u6240\u7528\u8a9e\u8a00\u7684\u5b57\u6bcd\u983b\u7387\u5206\u4f48\u6642\uff0cInternet Explorer\u5c31\u6703\u628a\u5b83\u8a8d\u6210\u97d3\u6587\u4f86\u986f\u793a\u3002<\/p>\n<\/blockquote>\n\n\n\n<p>\u63d0\u5230 BOM \u5c31\u4f86\u7c21\u55ae\u88dc\u5145\u4e00\u4e0b\u95dc\u65bc\u9019\u500b\u5b57\u662f\u600e\u9ebc\u4f86\u7684\u597d\u4e86\uff1a\u9019\u500b\u5b57 U+FEFF \u6700\u4e00\u958b\u59cb\u7684\u7528\u9014\u662f\u300c\u96f6\u5bec\u5ea6\u4e0d\u65b7\u884c\u7a7a\u767d\u300d<sup data-fn=\"0bdd08f0-1ad4-49ce-9286-e3df9e7ed959\" class=\"fn\"><a href=\"#0bdd08f0-1ad4-49ce-9286-e3df9e7ed959\" id=\"0bdd08f0-1ad4-49ce-9286-e3df9e7ed959-link\">3<\/a><\/sup>\uff0c\u662f\u4e00\u500b\u9664\u4e86\u591a\u4e00\u500b\u96b1\u5f62\u5b57\u5728\u90a3\u88e1\u4e4b\u5916\u5c0d\u6392\u7248\u4ec0\u9ebc\u7684\u5b8c\u5168\u6c92\u6709\u5f71\u97ff\u7684\u300c\u5b57\u300d\uff0c\u800c\u4e14\u5c07\u5b83\u5b58\u6210 UTF-16 \u6642\u5169\u500b\u4f4d\u5143\u7d44\u662f\u4e0d\u540c\u7684\u3002\u4e5f\u662f\u56e0\u70ba\u9019\u4e9b\u6027\u8cea\uff0c\u624d\u6709\u4eba\u60f3\u5230\u628a\u5b83\u653e\u5728\u6587\u5b57\u6a94\u7684\u958b\u982d\u7576\u505a\u985e\u4f3c\u65bc\u8fa8\u8a8d\u6a94\u6848\u683c\u5f0f\u7684 Magic Number\uff0c\u4f86\u8868\u793a\u9019\u500b UTF-16 \u662f\u5927\u982d\u9084\u662f\u5c0f\u982d\u7de8\u78bc (\u9019\u5373\u662f\u5b83\u73fe\u5728\u7684\u540d\u5b57\u7684\u4f86\u6e90\uff1aByte Order Mark\uff0c\u4f4d\u5143\u7d44\u9806\u5e8f\u8a18\u865f)\u3002\u5f8c\u4f86 U+FEFF \u9019\u500b\u5b57\u6f14\u8b8a\u6210\u5c08\u9580\u7528\u4f86\u505a\u9019\u7a2e\u6a19\u8a18 (\u539f\u672c\u7684\u4e0d\u65b7\u884c\u7a7a\u767d\u7684\u7528\u9014\u73fe\u5728\u7d66\u4e86 U+2060 Word Joiner)\uff0c\u6240\u4ee5\u4f4d\u5143\u7d44\u53cd\u904e\u4f86\u7684 U+FFFE \u5c31\u88ab\u4fdd\u7559\uff0c\u4e0d\u5728\u9019\u500b\u4f4d\u7f6e\u5b9a\u7fa9\u5b57\uff0c\u4f7f\u5f97\u8aa4\u5224\u4f4d\u5143\u7d44\u9806\u5e8f\u7684\u6a5f\u6703\u964d\u5230\u6700\u4f4e\u3002<\/p>\n\n\n\n<p>\u5c0d\u65bc UTF-8\uff0c\u6216\u8a31\u7531\u65bc\u8f49\u63db\u7a0b\u5ea6\u6c92\u6709\u7279\u5225\u8655\u7406\uff0c\u6216\u8a31\u56e0\u70ba BOM \u985e\u4f3c\u65bc Magic Number \u7684\u7528\u6cd5\u800c\u932f\u8aa4\u5730\u8a8d\u70ba UTF-8 \u4e5f\u8981\u4f7f\u7528\u9019\u500b\u5b57\u505a\u6a19\u8a18\uff0cBOM \u5b57\u5143\u7684 UTF-8 \u8868\u793a <code data-enlighter-language=\"raw\" class=\"EnlighterJSRAW\">0xEF 0xBB 0xBF<\/code> \u4e5f\u6703\u51fa\u73fe\u5728\u5f88\u591a UTF-8 \u7de8\u78bc\u7684\u6587\u5b57\u6a94\u7684\u958b\u982d (\u50cf\u662f Windows \u5167\u5efa\u7684\u8a18\u4e8b\u672c\u5b58\u6210 UTF-8 \u6642\u5c31\u4e00\u5b9a\u6703\u52a0\u4e0a)\uff1bUnicode \u6a19\u6e96\u5141\u8a31\u4f46\u4e0d\u9f13\u52f5\uff0c\u7562\u7adf\u4e00\u4f86 UTF-8 \u672c\u4f86\u5c31\u4e0d\u9700\u8981\u9019\u6a23\u7684\u6a19\u8a18\uff0c\u4e8c\u4f86\u5176\u4f4d\u5143\u7d44\u7d44\u5408\u7684\u8a2d\u8a08\u4e0d\u5bb9\u6613\u5728\u5176\u4ed6 DBCS \u7de8\u78bc\u88e1\u51fa\u73fe\uff0c\u4e09\u4f86\u6709\u4e9b\u7a0b\u5f0f\u66f4\u662f\u9700\u8981\u4e0d\u52a0 BOM \u624d\u80fd\u6b63\u78ba\u904b\u4f5c\u3002\u6700\u5f8c\u9019\u4e00\u9ede\u6700\u60e1\u540d\u662d\u5f70\u7684\u4f8b\u5b50\u5c31\u662f PHP\uff1a\u5982\u679c\u8981\u4f7f\u7528 UTF-8 \u505a\u70ba PHP \u7a0b\u5f0f\u7684\u7de8\u78bc\u7684\u8a71\uff0c\u5fc5\u9808\u4e0d\u52a0 BOM \u6709\u4e9b\u529f\u80fd\u624d\u80fd\u6b63\u5e38\u904b\u4f5c\u3002\u9019\u4e00\u9ede\u751a\u81f3\u5230\u4e86\u73fe\u5728\u7684 PHP 7 \u4ecd\u7136\u5982\u6b64\uff0c\u6240\u6301\u7684\u7406\u7531\u5c31\u662f PHP \u53ea\u7ba1 <code data-enlighter-language=\"php\" class=\"EnlighterJSRAW\">&lt;?php ?&gt;<\/code> \u88e1\u9762\u7684\u6771\u897f\uff0c\u6240\u4ee5\u5728\u90a3\u5916\u9762\u7684 BOM \u4e0d\u6b78\u6211\u7ba1\u3002<sup data-fn=\"ee4347a7-1d7a-48d9-a856-70c2b0a19339\" class=\"fn\"><a href=\"#ee4347a7-1d7a-48d9-a856-70c2b0a19339\" id=\"ee4347a7-1d7a-48d9-a856-70c2b0a19339-link\">4<\/a><\/sup><\/p>\n\n\n\n<h2 class=\"wp-block-heading\">\u5403\u6389\u4e00\u534a\u7684\u5b57<\/h2>\n\n\n\n<p>\u4ee5\u4e0a\u8ac7\u7684\u662f\u7531\u65bc\u5b57\u78bc\u9801\u89e3\u91cb\u4e0d\u540c\u9020\u6210\u7684\u4e82\u78bc\u3002\u4f46\u5176\u5be6 DBCS \u7de8\u78bc\u9084\u6709\u53e6\u4e00\u7a2e\u4e82\u78bc\u7684\u6210\u56e0\uff1a\u5169\u500b\u4e00\u7d44\u7684\u4f4d\u5143\u7d44\u6709\u4e00\u500b\u56e0\u70ba\u5404\u7a2e\u539f\u56e0\u4e0d\u898b\u4e86\u3002\u4e0d\u898b\u7684\u539f\u56e0\u6709\u5f88\u591a\uff1a<\/p>\n\n\n\n<ul class=\"wp-block-list\">\n<li>\u56e0\u70ba\u5404\u7a2e\u539f\u56e0\uff0c\u8b80\u53d6\u7684\u8d77\u59cb\u9ede\u4e26\u4e0d\u662f\u4e00\u500b\u5b57\u7684\u7b2c\u4e00\u4f4d\u5143\u7d44\uff1b<\/li>\n\n\n\n<li>\u5b57\u4e32\u7b2c\u4e00\u500b\u4f4d\u5143\u7d44\u7531\u65bc\u5404\u7a2e\u64cd\u4f5c\u539f\u56e0\u88ab\u5ffd\u7565\u4e86\uff1b<\/li>\n\n\n\n<li>\u5b57\u4e32\u7b2c\u4e8c\u500b\u4f4d\u5143\u7d44\u56e0\u70ba\u885d\u78bc\u88ab\u5403\u6389\u4e86\uff1b<\/li>\n\n\n\n<li>\u7b49\u7b49<\/li>\n<\/ul>\n\n\n\n<p>\u9019\u9020\u6210\u7684\u7d50\u679c\u5c31\u662f\u6709\u4e00\u500b\u5b57\u7684\u5f8c\u534a\u4f4d\u5143\u7d44\u6703\u8ddf\u4e0b\u4e00\u500b\u5b57\u7684\u524d\u534a\u4f4d\u5143\u7d44\u4e00\u8d77\u89e3\u91cb\u6210\u4e00\u500b\u300c\u5b57\u300d\uff0c\u7136\u5f8c\u9019\u4e4b\u5f8c\u7684\u6240\u6709\u4f4d\u5143\u7d44\u7684\u89e3\u91cb\u5c31\u5168\u90e8\u6b6a\u6389\u4e86\uff0c\u7522\u751f\u6c92\u6709\u610f\u7fa9\u7684\u5b57\u3002\u5728 PTT \u4e0a\u4e0d\u6642\u6703\u770b\u5230\u6709\u4e9b\u63a8\u6587\u7684\u958b\u982d\u6703\u662f\u5947\u602a\u7684\u4e82\u78bc\uff0c\u90a3\u5c31\u662f\u5728\u8f38\u5165\u63a8\u6587\u6642\uff0c\u5b57\u4e32\u7684\u7b2c\u4e00\u500b\u4f4d\u5143\u7d44\u56e0\u70ba\u4e4b\u524d\u7684\u64cd\u4f5c\u7684\u95dc\u4fc2\u88ab\u5ffd\u7565\u4e86\uff0c\u4f7f\u5f97\u8f38\u5165\u6846\u6c92\u6709\u6536\u5230\u90a3\u500b\u4f4d\u5143\u7d44\uff0c\u56e0\u6b64\u5f97\u5230\u7684\u5b57\u4e32\u5c31\u6703\u51fa\u73fe\u4e82\u78bc\u4e86\u3002<\/p>\n\n\n\n<p>\u8209\u500b\u5be6\u969b\u7684\u4f8b\u5b50\uff1a\u5982\u679c\u628a\u5927\u4e94\u78bc\u7684\u300c\u6279\u8e22\u8e22\u5be6\u696d\u574a\u300d\u516d\u500b\u5b57 12 \u500b\u4f4d\u5143\u7d44\u4e2d\u7684\u7b2c\u4e00\u500b\u7d66\u53bb\u6389\u7684\u8a71\uff0c\u6703\u767c\u751f\u9019\u6a23\u7684\u932f\u8aa4\u89e3\u8b80\uff1a<\/p>\n\n\n\n<figure class=\"wp-block-image size-large\"><img loading=\"lazy\" decoding=\"async\" width=\"605\" height=\"118\" src=\"https:\/\/blog.cruciferslab.net\/wp-content\/uploads\/2021\/01\/image-1.png\" alt=\"\" class=\"wp-image-342\" srcset=\"https:\/\/blog.cruciferslab.net\/wp-content\/uploads\/2021\/01\/image-1.png 605w, https:\/\/blog.cruciferslab.net\/wp-content\/uploads\/2021\/01\/image-1-300x59.png 300w, https:\/\/blog.cruciferslab.net\/wp-content\/uploads\/2021\/01\/image-1-150x29.png 150w\" sizes=\"auto, (max-width: 605px) 100vw, 605px\" \/><\/figure>\n\n\n\n<p>\u8b8a\u6210\u4e86\u300c\u6576\u87e2\u85be\u7bde~\u574a\u300d\u9019\u6a23\u7684\u4e82\u78bc\u4e86\u3002\u53ef\u4ee5\u6ce8\u610f\u5230\uff0c\u5927\u4e94\u78bc\u7684\u7b2c\u4e8c\u500b\u4f4d\u5143\u7d44\u5305\u542b\u82f1\u6587\u5340\u7684\u4f4d\u5143\u7d44\u5728\u9019\u500b\u72c0\u6cc1\u88e1\u53cd\u800c\u662f\u500b\u597d\u8655\uff0c\u56e0\u70ba\u9019\u6a23\u7684\u89e3\u8b80\u932f\u8aa4\u6703\u5728\u82f1\u6587\u4f4d\u5143\u7d44\u505c\u6b62\uff0c\u628a\u90a3\u7b2c\u4e8c\u500b\u4f4d\u5143\u7d44\u89e3\u91cb\u6210\u4f7f\u7528\u4e00\u500b\u4f4d\u5143\u7d44\u7684\u82f1\u6587\uff0c\u7136\u5f8c\u5176\u5f8c\u7684\u5b57\u5c31\u53c8\u80fd\u6b63\u78ba\u89e3\u8b80\u4e86\u3002\u9019\u4e5f\u5c31\u662f\u70ba\u4ec0\u9ebc\u5728\u5927\u4e94\u78bc\u9019\u7a2e\u4e82\u78bc\u901a\u5e38\u53ea\u6703\u4e82\u958b\u982d\uff0c\u6703\u5728\u4e00\u500b\u82f1\u6587\u6216\u534a\u578b\u7b26\u865f\u4e4b\u5f8c\u56de\u5fa9\u6b63\u5e38\uff1b\u5176\u4ed6\u6c92\u6709\u4f7f\u7528\u82f1\u6587\u5340\u7684 EUC \u985e\u7de8\u78bc (\u4f8b\u5982 EUC-CN) \u5c31\u4e0d\u6703\u6709\u9019\u7a2e\u4fee\u6b63\u7684\u6a5f\u6703\uff0c\u4e00\u51fa\u9019\u7a2e\u932f\u5c31\u662f\u4e00\u6574\u4e32\u7684\u4e2d\u6587\u5168\u90e8\u4e82\u6389\u3002<\/p>\n\n\n\n<p>\u5468\u601d\u535a\u5728\u7c21\u55ae\u63d0\u5230 DBCS \u6642\u6709\u8aaa\u904e\uff0cDBCS \u7de8\u78bc\u7684\u6587\u5b57\u8981\u5f80\u524d\u6216\u5f80\u5f8c\u79fb\u4e00\u500b\u5b57\u4e26\u4e0d\u80fd\u76f4\u63a5\u5c07\u6307\u6a19 +1 \u6216 -1\uff0c\u800c\u8981\u547c\u53eb\u7279\u5225\u8655\u7406\u7684\u51fd\u6578\uff0c\u5176\u539f\u56e0\u5c31\u662f\u70ba\u4e86\u907f\u514d\u767c\u751f\u9019\u7a2e\u628a\u5b57\u5207\u4e00\u534a\u7684\u554f\u984c\u3002\u9019\u7a2e\u51fd\u6578\u6703\u5f80\u524d\u627e\u5230\u4e00\u500b\u80fd\u5920\u660e\u78ba\u5224\u65b7\u9019\u662f\u4e00\u500b\u5b57\u7684\u7b2c\u4e00\u4f4d\u5143\u7d44\u7684\u5730\u65b9\uff0c\u7136\u5f8c\u5f80\u5f8c\u6578\u5230\u76ee\u524d\u7684\u4f4d\u7f6e\u4f86\u6c7a\u5b9a\u5b83\u9644\u8fd1\u7684\u4f4d\u5143\u7d44\u7d44\u5408\u8981\u600e\u9ebc\u914d\u5c0d\uff0c\u9032\u800c\u53bb\u5c0d\u61c9\u5730\u64cd\u4f5c\u5b57\u4e32\u3002\u5728 PTT \u9019\u7a2e\u4ee5\u5927\u4e94\u78bc\u70ba\u5167\u78bc\u7684 BBS \u7cfb\u7d71\u7576\u4e2d\u9019\u7a2e\u5224\u65b7\u6703\u9700\u8981\u5728\u8f38\u5165\u6587\u5b57\u6642\u4e0d\u65b7\u9032\u884c\uff0c\u624d\u4e0d\u6703\u4e00\u4e0d\u5c0f\u5fc3\u628a\u4e00\u500b\u5b57\u5f9e\u4e2d\u9593\u5207\u65b7\u51fa\u73fe\u4e82\u78bc\u3002\u65e9\u671f\u7684 BBS \u9023\u7dda\u8edf\u9ad4\u7576\u4e2d\u56e0\u6b64\u6703\u6709\u300c\u5075\u6e2c\u6e38\u6a19\u662f\u4e0d\u662f\u5728\u4e2d\u6587\u5b57\u7684\u524d\u534a\u4e0a\uff0c\u662f\u7684\u8a71\u5de6\u53f3\u79fb\u6703\u5e6b\u4f60\u591a\u79fb\u4e00\u683c\u300d\u7684\u529f\u80fd\u5728\uff0c\u5e6b\u52a9\u6c92\u6709\u628a\u9019\u500b\u529f\u80fd\u505a\u5728 BBS \u7cfb\u7d71\u5c64\u7684\u7ad9\u79fb\u52d5\u6e38\u6a19\u66f4\u70ba\u76f4\u89ba\uff1b\u4e0d\u904e\u73fe\u5728 BBS \u5e7e\u4e4e\u53ea\u5269\u4e0b PTT \u4e86\uff0c\u800c PTT \u4e5f\u65e9\u5c31\u628a\u9019\u6a23\u7684\u529f\u80fd\u7d66\u5167\u5efa\uff0c\u6240\u4ee5\u73fe\u5728\u90fd\u662f\u5efa\u8b70\u4f7f\u7528\u8005\u628a\u9023\u7dda\u8edf\u9ad4\u7684\u8a2d\u5b9a\u95dc\u6389\u8b93 PTT \u505a\u8655\u7406\u3002<\/p>\n\n\n\n<h2 class=\"wp-block-heading\">\u5c0f\u7d50<\/h2>\n\n\n\n<p>\u95dc\u65bc\u4e82\u78bc\u5c31\u5927\u81f4\u5148\u8ac7\u5230\u9019\u88e1\u3002\u539f\u672c\u9019\u88e1\u662f\u9084\u60f3\u8981\u4f86\u8a73\u7d30\u89e3\u91cb\u6700\u958b\u982d\u7684\u90a3\u5f35\u8868\uff0c\u4ee5\u53ca\u8a0e\u8ad6\u5ef6\u4f38\u5230\u5927\u4e94\u78bc\u7684\u90e8\u4efd\u7684\uff0c\u4e0d\u904e\u7531\u65bc\u7d30\u7bc0\u975e\u5e38\u591a\uff0c\u5beb\u8d77\u4f86\u5927\u6982\u6703\u662f\u767e\u79d1\u5168\u66f8\u7b49\u7d1a\u7684\u6574\u7406\u5206\u6790\uff0c\u518d\u52a0\u4e0a\u73fe\u5728 Unicode \u666e\u53ca\u7a0b\u5ea6\u6bd4\u8d77\u5341\u5e7e\u4e8c\u5341\u5e74\u524d\u5df2\u7d93\u597d\u5f88\u591a\u4e86\uff0c\u9019\u6a23\u7684\u6574\u7406\u53ea\u6709\u842c\u4e00\u78b0\u5230\u4e86\u624d\u6703\u9700\u8981\u53c3\u8003\uff0c\u6240\u4ee5\u53ef\u80fd\u8981\u7b49\u6211\u975e\u5e38\u9592\u7684\u6642\u5019\u624d\u6703\u505a\u5427\u3002<\/p>\n\n\n\n<h2 class=\"wp-block-heading\">\u8a3b\u8173<\/h2>\n\n\n<ol class=\"wp-block-footnotes\"><li id=\"b7943b30-bb5c-4503-aa93-cd7171dd8ef4\">\u9084\u662f\u5f88\u8fd1\u671f\u7684\u5f8c\u4f86\uff1a\u662f\u6211\u5927\u7d04\u4e00\u5e74\u591a\u524d\u56e0\u70ba\u597d\u5947\u5fc3\u53bb\u641c\u9019\u500b\u5b57\u4e32\u624d\u641c\u5230<a href=\"http:\/\/ft-lab.ne.jp\/cgi-bin\/wiki.cgi?page=%A5%D5%A5%A9%A1%BC%A5%E0%A4%C7%A4%CE%CA%B8%BB%FA%B2%BD%A4%B1%5FPHP\">\u9019\u500b\u8001\u7db2\u9801<\/a>\u8b1b\u5230\u539f\u56e0\u7684\u3002\u9019\u5169\u6bb5\u7684\u89e3\u91cb\u5e7e\u4e4e\u90fd\u662f\u5f15\u7528\u81ea\u9019\u500b\u5730\u65b9\u3002 <a href=\"#b7943b30-bb5c-4503-aa93-cd7171dd8ef4-link\" aria-label=\"\u8fd4\u56de\u8a3b\u8173\u53c3\u7167 1\">\u21a9\ufe0e<\/a><\/li><li id=\"d8f9cce6-0520-40ff-b8d0-812798543380\">(2025\/5\/13 \u88dc\u8a3b) YouTube \u983b\u9053 FlyTech Videos \u7d04\u5728\u8fd1\u5169\u5e74\u524d\u505a\u4e86<a href=\"https:\/\/www.youtube.com\/watch?v=sPShnuBSvBg\">\u4e00\u5247\u5f71\u7247<\/a>\u89e3\u91cb\u9019\u500b bug\uff0c\u4e26\u4e14\u9644\u4e0a\u4e86\u4e00\u500b\u4f86\u81ea\u4ed6\u6240\u77e5\u7684<em>\u4f86\u6e90<\/em>\u6240\u63ed\u793a\u7684\u9019\u500b\u51fd\u6578\u7684\u5be6\u4f5c\u3002\u6839\u64da\u90a3\u500b<em>\u4f86\u6e90<\/em>\uff0c\u6211\u9019\u7bc7\u6587\u7ae0\u88e1\u7684\u8aaa\u6cd5\u6280\u8853\u4e0a\u4e26\u4e0d\u6b63\u78ba\uff1b\u6bd4\u8f03\u6b63\u78ba\u4e00\u9ede\u7684\u8aaa\u6cd5\u662f\uff1a\u7576\u9019\u4e32\u4f4d\u5143\u7d44\u89e3\u91cb\u6210 UTF16-LE \u6216 UTF16-BE \u6642\uff0c\u6240\u5f97\u5230\u7684 Unicode \u5b57\u5143<strong>\u90fd\u5728\u9644\u8fd1<\/strong>\uff0c\u56e0\u6b64\u5224\u65b7\u9019\u4e32\u4f4d\u5143\u7d44\u662f Unicode\u3002\u5f71\u7247\u88e1\u6709\u7d66\u51fa\u4e00\u500b\u9817\u70ba\u5967\u5999\u7684\u516c\u5f0f\u63cf\u8ff0\u9019\u500b\u51fd\u6578\u7684\u5224\u65b7\u6e96\u5247\uff0c\u9019\u500b\u300c\u90fd\u5728\u9644\u8fd1\u300d\u5247\u662f\u6211\u5c0d\u9019\u500b\u516c\u5f0f\u7684\u89e3\u8b80\uff1b\u4e4b\u6240\u4ee5\u6211\u6703\u4ee5\u70ba\u5b83\u662f\u4f9d\u7167\u6587\u5b57\u7684\u8a9e\u8a00\u4f86\u5224\u65b7\u7684\u539f\u56e0\uff0c\u5247\u662f\u7531\u65bc Unicode \u628a\u540c\u4e00\u8a9e\u8a00\u7684\u5b57\u90fd\u653e\u5728\u9644\u8fd1\u7684\u95dc\u4fc2\u3002 <a href=\"#d8f9cce6-0520-40ff-b8d0-812798543380-link\" aria-label=\"\u8fd4\u56de\u8a3b\u8173\u53c3\u7167 2\">\u21a9\ufe0e<\/a><\/li><li id=\"0bdd08f0-1ad4-49ce-9286-e3df9e7ed959\">Zero-Width No-Break SPace\uff0c\u7c21\u7a31 ZWNBSP\uff1b\u524d\u9762\u90a3\u500b\u540d\u5b57\u73fe\u5728\u4ecd\u7136\u662f U+FEFF \u7684\u6b63\u5f0f Unicode \u540d\u5b57\uff0c\u56e0\u70ba\u70ba\u4e86\u7dad\u6301\u5b57\u78bc\u8cc7\u6599\u5eab\u7684\u5411\u524d\u76f8\u5bb9\u6027\uff0c\u4e00\u500b Unicode \u5b57\u7684\u6b63\u5f0f\u540d\u5b57\u4e00\u65e6\u5b9a\u540d\u4e86\u5c31\u7121\u6cd5\u6539\u8b8a\u3002 <a href=\"#0bdd08f0-1ad4-49ce-9286-e3df9e7ed959-link\" aria-label=\"\u8fd4\u56de\u8a3b\u8173\u53c3\u7167 3\">\u21a9\ufe0e<\/a><\/li><li id=\"ee4347a7-1d7a-48d9-a856-70c2b0a19339\">\u5176\u4ed6\u9084\u6709\u6bd4\u8f03\u5c0f\u689d\u7684\u7406\u7531\uff0c\u4f8b\u5982\u82e5 PHP \u7522\u751f\u7684\u6587\u4ef6\u771f\u7684\u9700\u8981 BOM \u5247\u9700\u8981\u4fdd\u6301\u80fd\u5920\u7522\u751f\u7684\u65b9\u5f0f\u7b49\u7b49\uff0c\u4f46\u6700\u5927\u7684\u7406\u7531\u771f\u7684\u5c31\u662f\u90a3\u4e0d\u6b78\u6211\u7ba1\u6240\u4ee5\u6211\u4e0d\u60f3\u7ba1\u2026\u2026 <a href=\"#ee4347a7-1d7a-48d9-a856-70c2b0a19339-link\" aria-label=\"\u8fd4\u56de\u8a3b\u8173\u53c3\u7167 4\">\u21a9\ufe0e<\/a><\/li><\/ol>","protected":false},"excerpt":{"rendered":"<p>\u7cfb\u5217\u6587\u7ae0\u7684\u7b2c\u4e8c\u7bc7\uff0c\u5c31\u4f86\u7c21\u55ae\u8ac7\u8ac7\u6240\u8b02\u7684\u300c\u4e82\u78bc\u300d\u5427\u3002 \u4e82\u78bc\u8207\u4ed6\u5011\u7684\u7522\u5730 \u9019\u7bc0\u7684\u6a19\u984c\u662f\u4e00\u7bc7 Facebook \u8f49\u8cbc\u6587 [&hellip;]<\/p>\n","protected":false},"author":2,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"footnotes":"[{\"content\":\"\u9084\u662f\u5f88\u8fd1\u671f\u7684\u5f8c\u4f86\uff1a\u662f\u6211\u5927\u7d04\u4e00\u5e74\u591a\u524d\u56e0\u70ba\u597d\u5947\u5fc3\u53bb\u641c\u9019\u500b\u5b57\u4e32\u624d\u641c\u5230<a href=\\\"http:\/\/ft-lab.ne.jp\/cgi-bin\/wiki.cgi?page=%A5%D5%A5%A9%A1%BC%A5%E0%A4%C7%A4%CE%CA%B8%BB%FA%B2%BD%A4%B1%5FPHP\\\">\u9019\u500b\u8001\u7db2\u9801<\/a>\u8b1b\u5230\u539f\u56e0\u7684\u3002\u9019\u5169\u6bb5\u7684\u89e3\u91cb\u5e7e\u4e4e\u90fd\u662f\u5f15\u7528\u81ea\u9019\u500b\u5730\u65b9\u3002\",\"id\":\"b7943b30-bb5c-4503-aa93-cd7171dd8ef4\"},{\"content\":\"(2025\/5\/13 \u88dc\u8a3b) YouTube \u983b\u9053 FlyTech Videos \u7d04\u5728\u8fd1\u5169\u5e74\u524d\u505a\u4e86<a href=\\\"https:\/\/www.youtube.com\/watch?v=sPShnuBSvBg\\\">\u4e00\u5247\u5f71\u7247<\/a>\u89e3\u91cb\u9019\u500b bug\uff0c\u4e26\u4e14\u9644\u4e0a\u4e86\u4e00\u500b\u4f86\u81ea\u4ed6\u6240\u77e5\u7684<em>\u4f86\u6e90<\/em>\u6240\u63ed\u793a\u7684\u9019\u500b\u51fd\u6578\u7684\u5be6\u4f5c\u3002\u6839\u64da\u90a3\u500b<em>\u4f86\u6e90<\/em>\uff0c\u6211\u9019\u7bc7\u6587\u7ae0\u88e1\u7684\u8aaa\u6cd5\u6280\u8853\u4e0a\u4e26\u4e0d\u6b63\u78ba\uff1b\u6bd4\u8f03\u6b63\u78ba\u4e00\u9ede\u7684\u8aaa\u6cd5\u662f\uff1a\u7576\u9019\u4e32\u4f4d\u5143\u7d44\u89e3\u91cb\u6210 UTF16-LE \u6216 UTF16-BE \u6642\uff0c\u6240\u5f97\u5230\u7684 Unicode \u5b57\u5143<strong>\u90fd\u5728\u9644\u8fd1<\/strong>\uff0c\u56e0\u6b64\u5224\u65b7\u9019\u4e32\u4f4d\u5143\u7d44\u662f Unicode\u3002\u5f71\u7247\u88e1\u6709\u7d66\u51fa\u4e00\u500b\u9817\u70ba\u5967\u5999\u7684\u516c\u5f0f\u63cf\u8ff0\u9019\u500b\u51fd\u6578\u7684\u5224\u65b7\u6e96\u5247\uff0c\u9019\u500b\u300c\u90fd\u5728\u9644\u8fd1\u300d\u5247\u662f\u6211\u5c0d\u9019\u500b\u516c\u5f0f\u7684\u89e3\u8b80\uff1b\u4e4b\u6240\u4ee5\u6211\u6703\u4ee5\u70ba\u5b83\u662f\u4f9d\u7167\u6587\u5b57\u7684\u8a9e\u8a00\u4f86\u5224\u65b7\u7684\u539f\u56e0\uff0c\u5247\u662f\u7531\u65bc Unicode \u628a\u540c\u4e00\u8a9e\u8a00\u7684\u5b57\u90fd\u653e\u5728\u9644\u8fd1\u7684\u95dc\u4fc2\u3002\",\"id\":\"d8f9cce6-0520-40ff-b8d0-812798543380\"},{\"content\":\"Zero-Width No-Break SPace\uff0c\u7c21\u7a31 ZWNBSP\uff1b\u524d\u9762\u90a3\u500b\u540d\u5b57\u73fe\u5728\u4ecd\u7136\u662f U+FEFF \u7684\u6b63\u5f0f Unicode \u540d\u5b57\uff0c\u56e0\u70ba\u70ba\u4e86\u7dad\u6301\u5b57\u78bc\u8cc7\u6599\u5eab\u7684\u5411\u524d\u76f8\u5bb9\u6027\uff0c\u4e00\u500b Unicode \u5b57\u7684\u6b63\u5f0f\u540d\u5b57\u4e00\u65e6\u5b9a\u540d\u4e86\u5c31\u7121\u6cd5\u6539\u8b8a\u3002\",\"id\":\"0bdd08f0-1ad4-49ce-9286-e3df9e7ed959\"},{\"content\":\"\u5176\u4ed6\u9084\u6709\u6bd4\u8f03\u5c0f\u689d\u7684\u7406\u7531\uff0c\u4f8b\u5982\u82e5 PHP \u7522\u751f\u7684\u6587\u4ef6\u771f\u7684\u9700\u8981 BOM \u5247\u9700\u8981\u4fdd\u6301\u80fd\u5920\u7522\u751f\u7684\u65b9\u5f0f\u7b49\u7b49\uff0c\u4f46\u6700\u5927\u7684\u7406\u7531\u771f\u7684\u5c31\u662f\u90a3\u4e0d\u6b78\u6211\u7ba1\u6240\u4ee5\u6211\u4e0d\u60f3\u7ba1\u2026\u2026\",\"id\":\"ee4347a7-1d7a-48d9-a856-70c2b0a19339\"}]"},"categories":[5,4],"tags":[],"class_list":["post-148","post","type-post","status-publish","format-standard","hentry","category-encoding","category-programming"],"_links":{"self":[{"href":"https:\/\/blog.cruciferslab.net\/index.php?rest_route=\/wp\/v2\/posts\/148","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/blog.cruciferslab.net\/index.php?rest_route=\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/blog.cruciferslab.net\/index.php?rest_route=\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/blog.cruciferslab.net\/index.php?rest_route=\/wp\/v2\/users\/2"}],"replies":[{"embeddable":true,"href":"https:\/\/blog.cruciferslab.net\/index.php?rest_route=%2Fwp%2Fv2%2Fcomments&post=148"}],"version-history":[{"count":42,"href":"https:\/\/blog.cruciferslab.net\/index.php?rest_route=\/wp\/v2\/posts\/148\/revisions"}],"predecessor-version":[{"id":2209,"href":"https:\/\/blog.cruciferslab.net\/index.php?rest_route=\/wp\/v2\/posts\/148\/revisions\/2209"}],"wp:attachment":[{"href":"https:\/\/blog.cruciferslab.net\/index.php?rest_route=%2Fwp%2Fv2%2Fmedia&parent=148"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/blog.cruciferslab.net\/index.php?rest_route=%2Fwp%2Fv2%2Fcategories&post=148"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/blog.cruciferslab.net\/index.php?rest_route=%2Fwp%2Fv2%2Ftags&post=148"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}