{"id":324,"date":"2023-02-25T06:19:31","date_gmt":"2023-02-24T22:19:31","guid":{"rendered":"https:\/\/www.appblog.cn\/?p=324"},"modified":"2023-04-30T14:54:13","modified_gmt":"2023-04-30T06:54:13","slug":"solution-to-processing-uft-8-encoding-file-error-with-java","status":"publish","type":"post","link":"https:\/\/www.appblog.cn\/index.php\/2023\/02\/25\/solution-to-processing-uft-8-encoding-file-error-with-java\/","title":{"rendered":"Java\u5904\u7406UFT-8\u7f16\u7801\u6587\u4ef6\u51fa\u73b0\\ufeff\u7684\u89e3\u51b3\u65b9\u6cd5"},"content":{"rendered":"<p>\u5728\u5904\u7406\u652f\u4ed8\u5b9d\u3001\u5fae\u4fe1\u652f\u4ed8\u7b49\u5bf9\u8d26\u6587\u4ef6\u65f6\u53ef\u80fd\u4f1a\u78b0\u5230\u56e0\u4e3a<code>\\ufeff<\/code>\u5b57\u7b26\u5bfc\u81f4\u5b57\u6bb5\u89e3\u6790\u9519\u8bef\u3002<code>\\ufeff<\/code>\u8fd9\u662f\u54ea\u6765\u7684\u5462\uff1f\u7f51\u4e0a\u641c\u7d22\u540e\u53d1\u73b0\u539f\u6765\u662f\u6587\u672c\u4fdd\u5b58\u65f6\u5305\u542b\u4e86BOM\uff08Byte Order Mark\uff0c\u5b57\u8282\u987a\u5e8f\u6807\u8bb0\uff0c\u51fa\u73b0\u5728\u6587\u672c\u6587\u4ef6\u5934\u90e8\uff0cUnicode\u7f16\u7801\u6807\u51c6\u4e2d\u7528\u4e8e\u6807\u8bc6\u6587\u4ef6\u662f\u91c7\u7528\u54ea\u79cd\u683c\u5f0f\u7684\u7f16\u7801\uff09\u5bfc\u81f4\u7684\uff0c\u89e3\u51b3\u65b9\u6cd5\u662f\u4f7f\u7528<code>utf-8-sig<\/code>\u7f16\u7801\uff08\u65e0BOM\u683c\u5f0f\uff09\uff1a<\/p>\n<p>\u5982\u679c\u6587\u4ef6\u7f16\u7801\u683c\u5f0f\u4e0d\u53ef\u53d8\u66f4\uff0c\u5219\u5220\u9664<code>\\ufeff<\/code>\u5373\u53ef<\/p>\n<p><!-- more --><\/p>\n<pre><code class=\"language-java\">@Override\nprotected List&lt;String&gt; parseColumnNames(List&lt;String&gt; lines) {\n    return convertToList(lines.get(0).replace(&quot;\\ufeff&quot;, &quot;&quot;), split);\n}<\/code><\/pre>\n","protected":false},"excerpt":{"rendered":"<p>\u5728\u5904\u7406\u652f\u4ed8\u5b9d\u3001\u5fae\u4fe1\u652f\u4ed8\u7b49\u5bf9\u8d26\u6587\u4ef6\u65f6\u53ef\u80fd\u4f1a\u78b0\u5230\u56e0\u4e3a\\ufeff\u5b57\u7b26\u5bfc\u81f4\u5b57\u6bb5\u89e3\u6790\u9519\u8bef\u3002\\ufeff\u8fd9\u662f\u54ea\u6765\u7684\u5462\uff1f\u7f51 [&hellip;]<\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[43],"tags":[],"class_list":["post-324","post","type-post","status-publish","format-standard","hentry","category-java-basic"],"_links":{"self":[{"href":"https:\/\/www.appblog.cn\/index.php\/wp-json\/wp\/v2\/posts\/324","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/www.appblog.cn\/index.php\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/www.appblog.cn\/index.php\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/www.appblog.cn\/index.php\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/www.appblog.cn\/index.php\/wp-json\/wp\/v2\/comments?post=324"}],"version-history":[{"count":0,"href":"https:\/\/www.appblog.cn\/index.php\/wp-json\/wp\/v2\/posts\/324\/revisions"}],"wp:attachment":[{"href":"https:\/\/www.appblog.cn\/index.php\/wp-json\/wp\/v2\/media?parent=324"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/www.appblog.cn\/index.php\/wp-json\/wp\/v2\/categories?post=324"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/www.appblog.cn\/index.php\/wp-json\/wp\/v2\/tags?post=324"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}