{"id":577,"date":"2022-03-10T11:05:37","date_gmt":"2022-03-10T03:05:37","guid":{"rendered":"https:\/\/22pig.com\/?p=577"},"modified":"2022-03-10T11:05:37","modified_gmt":"2022-03-10T03:05:37","slug":"eclipse%e8%ae%be%e7%bd%ae%e5%85%a8%e5%b1%80%e7%bc%96%e7%a0%81%e4%b8%bautf-8%e7%9a%84%e6%96%b9%e6%b3%95","status":"publish","type":"post","link":"http:\/\/22pig.com\/?p=577","title":{"rendered":"ECLIPSE\u8bbe\u7f6e\u5168\u5c40\u7f16\u7801\u4e3aUTF-8\u7684\u65b9\u6cd5"},"content":{"rendered":"<p>\u5982\u679c\u8981\u4f7f\u63d2\u4ef6\u5f00\u53d1\u5e94\u7528\u80fd\u6709\u66f4\u597d\u7684\u56fd\u9645\u5316\u652f\u6301\uff0c\u80fd\u591f\u6700\u5927\u7a0b\u5ea6\u7684\u652f\u6301\u4e2d\u6587\u8f93\u51fa\uff0c\u5219\u6700\u597d\u4f7f Java\u6587\u4ef6\u4f7f\u7528UTF-8\u7f16\u7801\u3002\u7136\u800c\uff0cEclipse\u5de5\u4f5c\u7a7a\u95f4(workspace)\u7684\u7f3a\u7701\u5b57\u7b26\u7f16\u7801\u662f\u64cd\u4f5c\u7cfb\u7edf\u7f3a\u7701\u7684\u7f16\u7801\uff0c\u7b80\u4f53\u4e2d\u6587\u64cd\u4f5c\u7cfb\u7edf (Windows XP\u3001Windows 2000\u7b80\u4f53\u4e2d\u6587)\u7684\u7f3a\u7701\u7f16\u7801\u662fGB18030\uff0c\u5728\u6b64\u5de5\u4f5c\u7a7a\u95f4\u4e2d\u5efa\u7acb\u7684\u5de5\u7a0b\u7f16\u7801\u662fGB18030\uff0c\u5de5\u7a0b\u4e2d\u5efa\u7acb\u7684java\u6587\u4ef6\u4e5f\u662fGB18030\u3002<\/p>\n<p>\u5982\u679c\u8981\u4f7f\u65b0\u5efa\u7acb\u5de5\u7a0b\u3001java\u6587\u4ef6\u76f4\u63a5\u4f7fUTF-8\u5219\u9700\u8981\u505a\u4ee5\u4e0b\u5de5\u4f5c\uff1a<\/p>\n<p>\uff11\u3001windows-&gt;Preferences&#8230;\u6253\u5f00&#8221;\u9996\u9009\u9879&#8221;\u5bf9\u8bdd\u6846\uff0c\u5de6\u4fa7\u5bfc\u822a\u6811\uff0c\u5bfc\u822a\u5230general-&gt;Workspace\uff0c\u53f3\u4fa7Text file encoding\uff0c\u9009\u62e9Other\uff0c\u6539\u53d8\u4e3aUTF-8\uff0c\u4ee5\u540e\u65b0\u5efa\u7acb\u5de5\u7a0b\u5176\u5c5e\u6027\u5bf9\u8bdd\u6846\u4e2d\u7684Text file encoding\u5373\u4e3aUTF-8\u3002<\/p>\n<p>\uff12\u3001windows-&gt;Preferences&#8230;\u6253\u5f00&#8221;\u9996\u9009\u9879&#8221;\u5bf9\u8bdd\u6846\uff0c\u5de6\u4fa7\u5bfc\u822a\u6811\uff0c\u5bfc\u822a\u5230general-&gt;Content Types\uff0c\u53f3\u4fa7Context Types\u6811\uff0c\u70b9\u5f00Text\u4e2d\u6bcf\u4e00\u4e2a\u5b50\u9879,\u5e76\u5c06\u5176\u7f16\u7801\u8bbe\u7f6e\u4e3a&#8221;UTF-8&#8243;,\u70b9update!<\/p>\n<p>\u5176\u4ed6java\u5e94\u7528\u5f00\u53d1\u76f8\u5173\u7684\u6587\u4ef6\u5982\uff1aproperties\u3001XML\u7b49\u5df2\u7ecf\u7531Eclipse\u7f3a\u7701\u6307\u5b9a\uff0c\u5206\u522b\u4e3aISO8859-1\uff0cUTF-8\uff0c\u5982\u5f00\u53d1\u4e2d\u786e\u9700\u6539\u53d8\u7f16\u7801\u683c\u5f0f\u5219\u53ef\u4ee5\u5728\u6b64\u6307\u5b9a\u3002<\/p>\n<p>\uff13\u3001window&#8211;&gt;preference&#8211;&gt;MyEclipse&#8211;&gt;Files and Editors,\u5c06\u6bcf\u4e2a\u5b50\u9879\u7684&#8221;Encoding&#8221;\u6539\u4e3a&#8221;ISO 10645\/Unicode(UTF-8)&#8221;,\u70b9Apply!<\/p>\n<p>\uff14\u3001\u7ecf\u8fc7\u4e0a\u8ff0\u4e09\u6b65\uff0c\u65b0\u5efajava\u6587\u4ef6\u5373\u4e3aUTF-8\u7f16\u7801\uff0cEclipse\u7f16\u8bd1\u3001\u8fd0\u884c\u3001\u8c03\u8bd5\u90fd\u6ca1\u95ee\u9898\uff0c\u4f46\u662f\u505aRCP\u5e94\u7528\u7684Product\u8f93\u51fa\u65f6\u3001\u6216\u8005\u63d2\u4ef6\u8f93\u51fa\u65f6\uff0c\u5219\u603b\u662f\u51fa\u9519\uff0c\u8981\u4e48\u4e0d\u80fd\u7f16\u8bd1\u901a\u8fc7(\u8f93\u51fa\u65f6\u8981\u91cd\u65b0compile)\u3001\u8981\u4e48\u8f93\u51fa\u7684\u63d2\u4ef6\u8fd0\u884c\u65f6\u4e2d\u6587\u663e\u793a\u4e71\u7801\u3002\u6b64\u65f6\u9700\u8981\u518dRCP\u5e94\u7528\u3001\u6216\u63d2\u4ef6Plugin\u5de5\u7a0b\u7684build.properties\u4e2d\u589e\u52a0\u4e00\u884c\uff0cjavacDefaultEncoding.. = UTF-8\u3002\u8ba9\u8f93\u51fa\u65f6\u7f16\u8bd1\u77e5\u9053java\u6e90\u6587\u4ef6\u65f6UTF-8\u7f16\u7801\u3002\u8fd9\u4e2a\u8bbe\u7f6e\u9700\u8981\u4fdd\u8bc1\u6240\u6709\u7684java\u6e90\u6587\u4ef6\u65f6UTF-8\u7f16\u7801\u683c\u5f0f\uff0c\u5982\u679c\u4e0d\u5168\u662f\uff0c\u53ef\u4ee5\u53c2\u8003 Eclipse\u5e2e\u4e2d(Plug-in Development Environment Guide &gt; Reference &gt; Feature and Plug-in Build configuration)\uff0c\u5efa\u8bae\u5168\u90e8java\u6e90\u6587\u4ef6\u662fUTF-8\u7f16\u7801\u3002<\/p>\n<p>\u5982\u679c\u63d2\u4ef6\u5f00\u53d1\u3001RCP\u5e94\u7528\u5f00\u53d1\u539f\u6765\u57fa\u4e8e\u5176\u4ed6\u7f16\u7801\uff0c\u5982GB18030\uff0c\u60f3\u8f6c\u6362\u4e3aUTF-8\uff0c\u5219\u9996\u5148\uff0c\u505a\u4ee5\u4e0a\u5de5\u4f5c\uff1b\u7136\u540e\u901a\u8fc7\u67e5\u627e\u7f16\u7801\u8f6c\u6362\u5de5\u5177\uff0c\u5982\u57fa\u4e8e iconv\u7684\u6279\u91cf\u8f6c\u6362\u5de5\u5177\uff0c\u5c06\u539f\u7f16\u7801\u8f6c\u6362<\/p>\n","protected":false},"excerpt":{"rendered":"<p>\u5982\u679c\u8981\u4f7f\u63d2\u4ef6\u5f00\u53d1\u5e94\u7528\u80fd\u6709\u66f4\u597d\u7684\u56fd\u9645\u5316\u652f\u6301\uff0c\u80fd\u591f\u6700\u5927\u7a0b\u5ea6\u7684\u652f\u6301\u4e2d\u6587\u8f93\u51fa\uff0c\u5219\u6700\u597d\u4f7f Java\u6587\u4ef6\u4f7f\u7528UTF-8\u7f16\u7801\u3002\u7136\u800c\uff0cEclipse\u5de5\u4f5c\u7a7a\u95f4(workspace)\u7684\u7f3a\u7701\u5b57\u7b26\u7f16\u7801\u662f\u64cd\u4f5c\u7cfb\u7edf\u7f3a\u7701\u7684\u7f16\u7801\uff0c\u7b80\u4f53\u4e2d\u6587\u64cd\u4f5c\u7cfb\u7edf (Windows XP\u3001Windows 2000\u7b80\u4f53\u4e2d\u6587)\u7684\u7f3a\u7701\u7f16\u7801\u662fGB18030\uff0c\u5728\u6b64\u5de5\u4f5c\u7a7a\u95f4\u4e2d\u5efa\u7acb\u7684\u5de5\u7a0b\u7f16\u7801\u662fGB18030\uff0c\u5de5\u7a0b\u4e2d\u5efa\u7acb\u7684java\u6587\u4ef6\u4e5f\u662fGB18030\u3002 \u5982\u679c\u8981\u4f7f\u65b0\u5efa\u7acb\u5de5\u7a0b\u3001java\u6587\u4ef6\u76f4\u63a5\u4f7fUTF-8\u5219\u9700\u8981\u505a\u4ee5\u4e0b\u5de5\u4f5c\uff1a \uff11\u3001windows-&gt;Preferences&#8230;\u6253\u5f00&#8221;\u9996\u9009\u9879&#8221;\u5bf9\u8bdd\u6846\uff0c\u5de6\u4fa7\u5bfc\u822a\u6811\uff0c\u5bfc\u822a\u5230general-&gt;Workspace\uff0c\u53f3\u4fa7Text file encoding\uff0c\u9009\u62e9Other\uff0c\u6539\u53d8\u4e3aUTF-8\uff0c\u4ee5\u540e\u65b0\u5efa\u7acb\u5de5\u7a0b\u5176\u5c5e\u6027\u5bf9\u8bdd\u6846\u4e2d\u7684Text file encoding\u5373\u4e3aUTF-8\u3002 \uff12\u3001windows-&gt;Preferences&#8230;\u6253\u5f00&#8221;\u9996\u9009\u9879&#8221;\u5bf9\u8bdd\u6846\uff0c\u5de6\u4fa7\u5bfc\u822a\u6811\uff0c\u5bfc\u822a\u5230general-&gt;Content Types\uff0c\u53f3\u4fa7Context Types\u6811\uff0c\u70b9\u5f00Text\u4e2d\u6bcf\u4e00\u4e2a\u5b50\u9879,\u5e76\u5c06\u5176\u7f16\u7801\u8bbe\u7f6e\u4e3a&#8221;UTF-8&#8243;,\u70b9update! \u5176\u4ed6java\u5e94\u7528\u5f00\u53d1\u76f8\u5173\u7684\u6587\u4ef6\u5982\uff1aproperties\u3001XML\u7b49\u5df2\u7ecf\u7531Eclipse\u7f3a\u7701\u6307\u5b9a\uff0c\u5206\u522b\u4e3aISO8859-1\uff0cUTF-8\uff0c\u5982\u5f00\u53d1\u4e2d\u786e\u9700\u6539\u53d8\u7f16\u7801\u683c\u5f0f\u5219\u53ef\u4ee5\u5728\u6b64\u6307\u5b9a\u3002 \uff13\u3001window&#8211;&gt;preference&#8211;&gt;MyEclipse&#8211;&gt;Files and Editors,\u5c06\u6bcf\u4e2a\u5b50\u9879\u7684&#8221;Encoding&#8221;\u6539\u4e3a&#8221;ISO 10645\/Unicode(UTF-8)&#8221;,\u70b9Apply! \uff14\u3001\u7ecf\u8fc7\u4e0a\u8ff0\u4e09\u6b65\uff0c\u65b0\u5efajava\u6587\u4ef6\u5373\u4e3aUTF-8\u7f16\u7801\uff0cEclipse\u7f16\u8bd1\u3001\u8fd0\u884c\u3001\u8c03\u8bd5\u90fd\u6ca1\u95ee\u9898\uff0c\u4f46\u662f\u505aRCP\u5e94\u7528\u7684Product\u8f93\u51fa\u65f6\u3001\u6216\u8005\u63d2\u4ef6\u8f93\u51fa\u65f6\uff0c\u5219\u603b\u662f\u51fa\u9519\uff0c\u8981\u4e48\u4e0d\u80fd\u7f16\u8bd1\u901a\u8fc7(\u8f93\u51fa\u65f6\u8981\u91cd\u65b0compile)\u3001\u8981\u4e48\u8f93\u51fa\u7684\u63d2\u4ef6\u8fd0\u884c\u65f6\u4e2d\u6587\u663e\u793a\u4e71\u7801\u3002\u6b64\u65f6\u9700\u8981\u518dRCP\u5e94\u7528\u3001\u6216\u63d2\u4ef6Plugin\u5de5\u7a0b\u7684build.properties\u4e2d\u589e\u52a0\u4e00\u884c\uff0cjavacDefaultEncoding.. = UTF-8\u3002\u8ba9\u8f93\u51fa\u65f6\u7f16\u8bd1\u77e5\u9053java\u6e90\u6587\u4ef6\u65f6UTF-8\u7f16\u7801\u3002\u8fd9\u4e2a\u8bbe\u7f6e\u9700\u8981\u4fdd\u8bc1\u6240\u6709\u7684java\u6e90\u6587\u4ef6\u65f6UTF-8\u7f16\u7801\u683c\u5f0f\uff0c\u5982\u679c\u4e0d\u5168\u662f\uff0c\u53ef\u4ee5\u53c2\u8003 Eclipse\u5e2e\u4e2d(Plug-in Development Environment Guide &gt; Reference &gt; Feature and Plug-in Build configuration)\uff0c\u5efa\u8bae\u5168\u90e8java\u6e90\u6587\u4ef6\u662fUTF-8\u7f16\u7801\u3002 \u5982\u679c\u63d2\u4ef6\u5f00\u53d1\u3001RCP\u5e94\u7528\u5f00\u53d1\u539f\u6765\u57fa\u4e8e\u5176\u4ed6\u7f16\u7801\uff0c\u5982GB18030\uff0c\u60f3\u8f6c\u6362\u4e3aUTF-8\uff0c\u5219\u9996\u5148\uff0c\u505a\u4ee5\u4e0a\u5de5\u4f5c\uff1b\u7136\u540e\u901a\u8fc7\u67e5\u627e\u7f16\u7801\u8f6c\u6362\u5de5\u5177\uff0c\u5982\u57fa\u4e8e iconv\u7684\u6279\u91cf\u8f6c\u6362\u5de5\u5177\uff0c\u5c06\u539f\u7f16\u7801\u8f6c\u6362<\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[7],"tags":[],"class_list":["post-577","post","type-post","status-publish","format-standard","hentry","category-java"],"_links":{"self":[{"href":"http:\/\/22pig.com\/index.php?rest_route=\/wp\/v2\/posts\/577","targetHints":{"allow":["GET"]}}],"collection":[{"href":"http:\/\/22pig.com\/index.php?rest_route=\/wp\/v2\/posts"}],"about":[{"href":"http:\/\/22pig.com\/index.php?rest_route=\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"http:\/\/22pig.com\/index.php?rest_route=\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"http:\/\/22pig.com\/index.php?rest_route=%2Fwp%2Fv2%2Fcomments&post=577"}],"version-history":[{"count":0,"href":"http:\/\/22pig.com\/index.php?rest_route=\/wp\/v2\/posts\/577\/revisions"}],"wp:attachment":[{"href":"http:\/\/22pig.com\/index.php?rest_route=%2Fwp%2Fv2%2Fmedia&parent=577"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"http:\/\/22pig.com\/index.php?rest_route=%2Fwp%2Fv2%2Fcategories&post=577"},{"taxonomy":"post_tag","embeddable":true,"href":"http:\/\/22pig.com\/index.php?rest_route=%2Fwp%2Fv2%2Ftags&post=577"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}