{"id":1202,"date":"2026-01-04T09:30:32","date_gmt":"2026-01-04T01:30:32","guid":{"rendered":"https:\/\/www.52runoob.com\/?p=1202"},"modified":"2026-01-04T09:30:32","modified_gmt":"2026-01-04T01:30:32","slug":"%e4%b8%ad%e6%97%a5%e9%9f%a9%e6%96%87%e5%ad%97%e4%b9%b1%e7%a0%81","status":"publish","type":"post","link":"https:\/\/www.52runoob.com\/index.php\/2026\/01\/04\/%e4%b8%ad%e6%97%a5%e9%9f%a9%e6%96%87%e5%ad%97%e4%b9%b1%e7%a0%81\/","title":{"rendered":"\u4e2d\u65e5\u97e9\u6587\u5b57\u4e71\u7801"},"content":{"rendered":"\n<p>\u660e\u767d\u4e86\uff0c\u4f60\u8bf4\u7684 <strong>\u201c\u4e2d\u65e5\u97e9\u6587\u5b57\u4e71\u7801\u201d\u201d<\/strong> \u95ee\u9898\u901a\u5e38\u53d1\u751f\u5728 <strong>\u7f51\u9875\u3001APP \u6216\u6587\u672c\u5904\u7406\u73af\u5883<\/strong>\u91cc\uff0c\u4e3b\u8981\u539f\u56e0\u548c\u89e3\u51b3\u65b9\u6848\u5982\u4e0b\uff0c\u6211\u7ed9\u4f60\u6574\u7406\u5f97\u975e\u5e38\u6e05\u695a\u3001\u53ef\u64cd\u4f5c\uff1a<\/p>\n\n\n\n<hr class=\"wp-block-separator has-alpha-channel-opacity\"\/>\n\n\n\n<h2 class=\"wp-block-heading\">1\ufe0f\u20e3 \u4e71\u7801\u539f\u56e0\u5206\u6790<\/h2>\n\n\n\n<h3 class=\"wp-block-heading\">\ud83d\udd39 1. \u7f16\u7801\u4e0d\u7edf\u4e00<\/h3>\n\n\n\n<ul class=\"wp-block-list\">\n<li>\u4e2d\u6587\u3001\u65e5\u6587\u3001\u97e9\u6587\u90fd\u5c5e\u4e8e <strong>\u591a\u5b57\u8282\u5b57\u7b26<\/strong>\uff08UTF-8 \u6216 UTF-16\uff09\u3002<\/li>\n\n\n\n<li>\u5982\u679c\u7cfb\u7edf\u6216\u8f6f\u4ef6\u4f7f\u7528 <strong>\u5355\u5b57\u8282\u7f16\u7801\uff08\u5982 ANSI \/ GBK \/ Shift-JIS \/ EUC-KR\uff09<\/strong> \u663e\u793a UTF-8 \u5185\u5bb9\uff0c\u5c31\u4f1a\u4e71\u7801\u3002<\/li>\n<\/ul>\n\n\n\n<h3 class=\"wp-block-heading\">\ud83d\udd39 2. \u5b57\u4f53\u7f3a\u5931<\/h3>\n\n\n\n<ul class=\"wp-block-list\">\n<li>\u67d0\u4e9b\u64cd\u4f5c\u7cfb\u7edf\u6216\u8bbe\u5907\u6ca1\u6709\u5b89\u88c5 <strong>\u652f\u6301\u65e5\u6587\/\u97e9\u6587\/\u4e2d\u6587\u7684\u5b57\u4f53<\/strong>\u3002<\/li>\n\n\n\n<li>\u4f8b\u5982\uff1a\n<ul class=\"wp-block-list\">\n<li>Windows \u672a\u5b89\u88c5\u97e9\u6587\u5b57\u4f53 \u2192 \u97e9\u6587\u663e\u793a\u4e3a\u65b9\u5757<\/li>\n\n\n\n<li>Linux \u670d\u52a1\u5668\u672a\u5b89\u88c5 Noto CJK \u5b57\u4f53 \u2192 \u4e2d\u65e5\u97e9\u65e0\u6cd5\u663e\u793a<\/li>\n<\/ul>\n<\/li>\n<\/ul>\n\n\n\n<h3 class=\"wp-block-heading\">\ud83d\udd39 3. \u6587\u4ef6\u5934 \/ BOM \u9519\u8bef<\/h3>\n\n\n\n<ul class=\"wp-block-list\">\n<li>UTF-8 \u6587\u4ef6\u672a\u52a0 BOM \u6216\u4f7f\u7528 UTF-16 \u6587\u4ef6\u9519\u8bef\u89e3\u6790\uff0c\u4e5f\u4f1a\u51fa\u73b0\u4e71\u7801\u3002<\/li>\n<\/ul>\n\n\n\n<h3 class=\"wp-block-heading\">\ud83d\udd39 4. \u6d4f\u89c8\u5668 \/ APP \u4e0d\u8bc6\u522b\u7f16\u7801<\/h3>\n\n\n\n<ul class=\"wp-block-list\">\n<li>\u6d4f\u89c8\u5668\u6216 APP \u9ed8\u8ba4\u4f7f\u7528 ISO-8859-1\u3001GBK\u3001Shift-JIS \u89e3\u6790 UTF-8 \u5185\u5bb9\uff0c\u5c31\u4f1a\u51fa\u73b0\u4e71\u7801\u3002<\/li>\n<\/ul>\n\n\n\n<hr class=\"wp-block-separator has-alpha-channel-opacity\"\/>\n\n\n\n<h2 class=\"wp-block-heading\">2\ufe0f\u20e3 \u89e3\u51b3\u65b9\u6cd5<\/h2>\n\n\n\n<h3 class=\"wp-block-heading\">\ud83d\udd39 \u65b9\u6848 A\uff1a\u7f51\u9875\/\u6d4f\u89c8\u5668<\/h3>\n\n\n\n<ol class=\"wp-block-list\">\n<li><strong>\u8bbe\u7f6e\u7f51\u9875\u7f16\u7801\u4e3a UTF-8<\/strong>\n<ul class=\"wp-block-list\">\n<li>Chrome \/ Edge \/ Firefox\uff1a\u53f3\u952e \u2192 \u68c0\u67e5 \u2192 Network \u2192 Headers \u2192 Content-Type \u2192 \u786e\u8ba4 charset=UTF-8<\/li>\n<\/ul>\n<\/li>\n\n\n\n<li><strong>HTML \u9875\u9762\u4e2d\u6dfb\u52a0 meta \u6807\u7b7e<\/strong>\uff1a<\/li>\n<\/ol>\n\n\n<div class=\"wp-block-syntaxhighlighter-code \"><pre class=\"brush: plain; title: ; notranslate\" title=\"\">\n&amp;lt;meta charset=&quot;UTF-8&quot;&gt;\n\n<\/pre><\/div>\n\n\n<ol start=\"3\" class=\"wp-block-list\">\n<li><strong>\u5b57\u4f53\u95ee\u9898<\/strong>\uff1a\u786e\u4fdd CSS \u8bbe\u7f6e\u5b57\u4f53\u652f\u6301\u4e2d\u6587\u3001\u65e5\u6587\u3001\u97e9\u6587\uff1a<\/li>\n<\/ol>\n\n\n<div class=\"wp-block-syntaxhighlighter-code \"><pre class=\"brush: plain; title: ; notranslate\" title=\"\">\nbody {\n    font-family: &quot;Noto Sans CJK&quot;, &quot;Microsoft YaHei&quot;, &quot;Malgun Gothic&quot;, sans-serif;\n}\n\n<\/pre><\/div>\n\n\n<hr class=\"wp-block-separator has-alpha-channel-opacity\"\/>\n\n\n\n<h3 class=\"wp-block-heading\">\ud83d\udd39 \u65b9\u6848 B\uff1a\u6587\u672c\u6587\u4ef6 \/ \u7f16\u7a0b\u73af\u5883<\/h3>\n\n\n\n<ol class=\"wp-block-list\">\n<li><strong>\u4fdd\u5b58\u6587\u4ef6\u4e3a UTF-8 \u7f16\u7801<\/strong>\n<ul class=\"wp-block-list\">\n<li>VS Code\u3001Sublime\u3001Notepad++ \u2192 File \u2192 Save with Encoding \u2192 UTF-8<\/li>\n<\/ul>\n<\/li>\n\n\n\n<li><strong>Python \u5904\u7406<\/strong>\uff1a<\/li>\n<\/ol>\n\n\n<div class=\"wp-block-syntaxhighlighter-code \"><pre class=\"brush: plain; title: ; notranslate\" title=\"\">\n# \u8bfb\u53d6 UTF-8 \u6587\u4ef6\nwith open(&quot;file.txt&quot;, &quot;r&quot;, encoding=&quot;utf-8&quot;) as f:\n    content = f.read()\n\n<\/pre><\/div>\n\n\n<ol start=\"3\" class=\"wp-block-list\">\n<li><strong>\u5199\u5165\u65f6\u4e5f\u6307\u5b9a UTF-8<\/strong><\/li>\n<\/ol>\n\n\n<div class=\"wp-block-syntaxhighlighter-code \"><pre class=\"brush: plain; title: ; notranslate\" title=\"\">\nwith open(&quot;file_out.txt&quot;, &quot;w&quot;, encoding=&quot;utf-8&quot;) as f:\n    f.write(content)\n\n<\/pre><\/div>\n\n\n<hr class=\"wp-block-separator has-alpha-channel-opacity\"\/>\n\n\n\n<h3 class=\"wp-block-heading\">\ud83d\udd39 \u65b9\u6848 C\uff1aAPP \/ Android \/ iOS<\/h3>\n\n\n\n<ul class=\"wp-block-list\">\n<li><strong>Android<\/strong>\uff1a\n<ul class=\"wp-block-list\">\n<li>TextView \/ WebView \u9ed8\u8ba4\u4f7f\u7528 UTF-8\uff0c\u4e00\u822c\u4e71\u7801\u662f <strong>\u5b57\u4f53\u7f3a\u5931<\/strong> \u6216 <strong>\u6587\u4ef6\u7f16\u7801\u9519\u8bef<\/strong>\u3002<\/li>\n\n\n\n<li>\u8bbe\u7f6e\u5b57\u4f53\uff1a<\/li>\n<\/ul>\n<\/li>\n<\/ul>\n\n\n<div class=\"wp-block-syntaxhighlighter-code \"><pre class=\"brush: plain; title: ; notranslate\" title=\"\">\n&amp;lt;TextView\n    android:fontFamily=&quot;@font\/noto_sans_cjk&quot;\n    android:text=&quot;\u4e2d\u65e5\u97e9\u6587\u5b57\u793a\u4f8b&quot; \/&gt;\n\n<\/pre><\/div>\n\n\n<ul class=\"wp-block-list\">\n<li><strong>iOS<\/strong>\uff1a\n<ul class=\"wp-block-list\">\n<li>UILabel \/ UITextView \u9ed8\u8ba4\u652f\u6301 UTF-8\uff0c\u65e0\u9700\u989d\u5916\u8bbe\u7f6e\u5b57\u4f53\u5373\u53ef\u663e\u793a\u4e2d\u6587\u3001\u65e5\u6587\u3001\u97e9\u6587\u3002<\/li>\n<\/ul>\n<\/li>\n<\/ul>\n\n\n\n<hr class=\"wp-block-separator has-alpha-channel-opacity\"\/>\n\n\n\n<h3 class=\"wp-block-heading\">\ud83d\udd39 \u65b9\u6848 D\uff1a\u6570\u636e\u5e93<\/h3>\n\n\n\n<ul class=\"wp-block-list\">\n<li><strong>MySQL \/ MariaDB<\/strong>\n<ul class=\"wp-block-list\">\n<li>\u5b57\u6bb5\u8bbe\u7f6e\uff1a<\/li>\n<\/ul>\n<\/li>\n<\/ul>\n\n\n<div class=\"wp-block-syntaxhighlighter-code \"><pre class=\"brush: plain; title: ; notranslate\" title=\"\">\nCREATE TABLE example (\n    text_column VARCHAR(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci\n);\n\n<\/pre><\/div>\n\n\n<ul class=\"wp-block-list\">\n<li>\u63d2\u5165 \/ \u67e5\u8be2\u65f6\u786e\u4fdd\u8fde\u63a5\u4f7f\u7528 UTF-8\uff1a<\/li>\n<\/ul>\n\n\n<div class=\"wp-block-syntaxhighlighter-code \"><pre class=\"brush: plain; title: ; notranslate\" title=\"\">\nSET NAMES utf8mb4;\n\n<\/pre><\/div>\n\n\n<hr class=\"wp-block-separator has-alpha-channel-opacity\"\/>\n\n\n\n<h3 class=\"wp-block-heading\">\ud83d\udd39 \u65b9\u6848 E\uff1a\u7cfb\u7edf\u7f3a\u5b57\u4f53<\/h3>\n\n\n\n<ul class=\"wp-block-list\">\n<li>\u5b89\u88c5 <strong>Noto CJK<\/strong> \u5b57\u4f53\uff1a\n<ul class=\"wp-block-list\">\n<li>Windows\uff1aNotoSansCJK-Regular.ttc<\/li>\n\n\n\n<li>Linux\uff1asudo apt install fonts-noto-cjk<\/li>\n\n\n\n<li>macOS\uff1a\u81ea\u5e26\u652f\u6301\u5927\u90e8\u5206\u4e2d\u65e5\u97e9\u6587\u5b57<\/li>\n<\/ul>\n<\/li>\n<\/ul>\n\n\n\n<hr class=\"wp-block-separator has-alpha-channel-opacity\"\/>\n\n\n\n<h2 class=\"wp-block-heading\">3\ufe0f\u20e3 \u603b\u7ed3<\/h2>\n\n\n\n<figure class=\"wp-block-table\"><table class=\"has-fixed-layout\"><thead><tr><th>\u573a\u666f<\/th><th>\u539f\u56e0<\/th><th>\u89e3\u51b3\u65b9\u6848<\/th><\/tr><\/thead><tbody><tr><td>\u7f51\u9875 \/ \u6d4f\u89c8\u5668<\/td><td>\u7f16\u7801\u4e0d\u7edf\u4e00<\/td><td>\u8bbe\u7f6e charset=UTF-8\uff0cCSS \u5b57\u4f53\u8bbe\u7f6e<\/td><\/tr><tr><td>\u6587\u672c \/ \u7a0b\u5e8f<\/td><td>\u6587\u4ef6\u7f16\u7801\u9519\u8bef<\/td><td>\u4fdd\u5b58 UTF-8 \/ \u6307\u5b9a\u7f16\u7801\u8bfb\u5199<\/td><\/tr><tr><td>APP \/ \u624b\u673a<\/td><td>\u5b57\u4f53\u7f3a\u5931 \/ \u7f16\u7801\u9519\u8bef<\/td><td>\u8bbe\u7f6e\u5b57\u4f53 \/ \u4fdd\u8bc1 UTF-8<\/td><\/tr><tr><td>\u6570\u636e\u5e93<\/td><td>\u5b57\u6bb5\u7f16\u7801\u4e0d\u652f\u6301<\/td><td>\u6539 utf8mb4\uff0c\u8fde\u63a5\u8bbe\u7f6e utf8mb4<\/td><\/tr><\/tbody><\/table><\/figure>\n\n\n\n<p>\u2705 \u5173\u952e\u539f\u5219\uff1a<br><strong>\u7edf\u4e00\u7f16\u7801\uff08UTF-8\uff09 + \u5b57\u4f53\u652f\u6301 + \u6b63\u786e\u89e3\u6790\u73af\u5883<\/strong> \u5c31\u80fd\u89e3\u51b3\u4e2d\u65e5\u97e9\u6587\u5b57\u4e71\u7801\u95ee\u9898\u3002<\/p>\n","protected":false},"excerpt":{"rendered":"<p>\u660e\u767d\u4e86\uff0c\u4f60\u8bf4\u7684 \u201c\u4e2d\u65e5\u97e9\u6587\u5b57\u4e71\u7801\u201d\u201d \u95ee\u9898\u901a\u5e38\u53d1\u751f\u5728 \u7f51\u9875\u3001APP \u6216\u6587\u672c\u5904\u7406\u73af&#8230; <a class=\"more-link\" href=\"https:\/\/www.52runoob.com\/index.php\/2026\/01\/04\/%e4%b8%ad%e6%97%a5%e9%9f%a9%e6%96%87%e5%ad%97%e4%b9%b1%e7%a0%81\/\">Continue Reading &rarr;<\/a><\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[12],"tags":[],"class_list":["post-1202","post","type-post","status-publish","format-standard","hentry","category-12"],"amp_enabled":true,"_links":{"self":[{"href":"https:\/\/www.52runoob.com\/index.php\/wp-json\/wp\/v2\/posts\/1202","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/www.52runoob.com\/index.php\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/www.52runoob.com\/index.php\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/www.52runoob.com\/index.php\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/www.52runoob.com\/index.php\/wp-json\/wp\/v2\/comments?post=1202"}],"version-history":[{"count":1,"href":"https:\/\/www.52runoob.com\/index.php\/wp-json\/wp\/v2\/posts\/1202\/revisions"}],"predecessor-version":[{"id":1203,"href":"https:\/\/www.52runoob.com\/index.php\/wp-json\/wp\/v2\/posts\/1202\/revisions\/1203"}],"wp:attachment":[{"href":"https:\/\/www.52runoob.com\/index.php\/wp-json\/wp\/v2\/media?parent=1202"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/www.52runoob.com\/index.php\/wp-json\/wp\/v2\/categories?post=1202"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/www.52runoob.com\/index.php\/wp-json\/wp\/v2\/tags?post=1202"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}