{"id":53,"date":"2020-01-16T10:43:48","date_gmt":"2020-01-16T02:43:48","guid":{"rendered":"http:\/\/blog.ohmmx.com\/?p=53"},"modified":"2020-02-03T11:15:06","modified_gmt":"2020-02-03T03:15:06","slug":"%e5%85%b3%e4%ba%8ewindows%e5%91%bd%e4%bb%a4%e8%a1%8c%e7%9a%84%e5%ad%97%e7%ac%a6%e9%9b%86","status":"publish","type":"post","link":"http:\/\/blog.ohmmx.com\/?p=53","title":{"rendered":"\u5173\u4e8eWindows\u547d\u4ee4\u884c\u7684\u5b57\u7b26\u96c6"},"content":{"rendered":"\n<p>win10\u81ea\u5e262\u4e2a\u547d\u4ee4\u884c\u5de5\u5177\uff0ccmd \u548c powershell\uff0c\u9ed8\u8ba4\u5b57\u7b26\u96c6 936\uff08GBK\uff09\u3002\u5176\u4ed6\u5e38\u7528\u7684\u5b57\u7b26\u96c6 437\uff08\u7f8e\u56fd\uff09\u300165001\uff08UTF-8\uff09\u3002<\/p>\n\n\n\n<p>\u67e5\u770b\u5f53\u524d\u7a97\u53e3\u5b57\u7b26\u96c6\uff1a<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code>chcp<\/code><\/pre>\n\n\n\n<p>\u66f4\u6539\u5f53\u524d\u7a97\u53e3\u5b57\u7b26\u96c6\uff1a<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code>chcp 65001<\/code><\/pre>\n\n\n\n<p>\u6211\u4eec\u60f3\u8981\u5728\u6253\u5f00\u7a97\u53e3\u7684\u65f6\u5019\u81ea\u52a8\u8bbe\u7f6e\u597d\u5b57\u7b26\u96c6\uff0c\u4e0d\u7136\u6bcf\u6b21\u90fd\u5f97\u8bbe\u7f6e\u4e00\u6b21\u53ef\u592a\u9ebb\u70e6\u4e86\u3002<\/p>\n\n\n\n<p class=\"has-large-font-size\">\u65b9\u6cd5\u4e00\uff1a\u7cfb\u7edf\u8bbe\u7f6e\uff08\u4ee5\u4e0b\u4e09\u4e2a\u65b9\u6cd5\u6253\u5f00\u533a\u57df\u8bbe\u7f6e\uff09<\/p>\n\n\n\n<p>1. \u5f00\u59cb &#8211; \u8bbe\u7f6e &#8211; \u65f6\u95f4\u548c\u8bed\u8a00 &#8211; \u65e5\u671f\u3001\u65f6\u95f4\u548c\u533a\u57df\u683c\u5f0f\u8bbe\u7f6e &#8211; \u5176\u4ed6\u65e5\u671f\u3001\u65f6\u95f4\u548c\u533a\u57df\u8bbe\u7f6e &#8211; \u533a\u57df<\/p>\n\n\n\n<p>2. \u63a7\u5236\u9762\u677f\uff08\u5c0f\u56fe\u6807\uff09 &#8211; \u533a\u57df<\/p>\n\n\n\n<p>3. \u8fd0\u884c &#8211; intl.cpl<\/p>\n\n\n\n<p>\u533a\u57df\u8bbe\u7f6e &#8211; \u7ba1\u7406\uff08\u6807\u7b7e\uff09 &#8211; \u66f4\u6539\u7cfb\u7edf\u533a\u57df\u8bbe\u7f6e&#8230; &#8211; [\u9009\u4e2d]Beta\u7248\uff1a\u4f7f\u7528 Unicode UTF-8 \u63d0\u4f9b\u5168\u7403\u8bed\u8a00\u652f\u6301 &#8211; \u91cd\u542f\u7cfb\u7edf<\/p>\n\n\n\n<p>\u91cd\u542f\u4ee5\u540e cmd \u548c powershell \u9ed8\u8ba4\u90fd\u4f7f\u7528 65001\uff08UTF-8\uff09\u5b57\u7b26\u96c6\u3002<\/p>\n\n\n\n<p>\u4f46\u662f\u6709\u4e2a\u6bd4\u8f83\u4e25\u91cd\u7684\u95ee\u9898\uff0c\u6709\u90e8\u5206\u8f6f\u4ef6\u5bf9 UTF-8 \u652f\u6301\u4e0d\u597d\u4f1a\u51fa\u73b0\u4e71\u7801\u3002<\/p>\n\n\n\n<p class=\"has-large-font-size\">\u65b9\u6cd5\u4e8c\uff1a\u529f\u80fd\u8bbe\u7f6e<\/p>\n\n\n\n<p class=\"has-medium-font-size\"><em>\u9488\u5bf9 cmd<\/em><\/p>\n\n\n\n<p>\u6253\u5f00\u6ce8\u518c\u8868\uff0c\u8fd0\u884c &#8211; regedit<\/p>\n\n\n\n<p> [HKEY_LOCAL_MACHINE\\Software\\Microsoft\\Command Processor\\Autorun] \u4fee\u6539\u503c\u4e3a chcp 65001 &gt;NUL<\/p>\n\n\n\n<p>\u5982\u679c\u5728  Command Processor \u4e0b\u6ca1\u6709 Autorun\uff0c\u81ea\u884c\u6dfb\u52a0\u4e00\u6761 \u5b57\u7b26\u4e32\u503c(S)\u3002<\/p>\n\n\n\n<p>\u8fd9\u6837\u5728\u542f\u52a8 cmd \u7684\u65f6\u5019\u4f1a\u5148\u6267\u884c chcp 65001 \u5c06\u5b57\u7b26\u96c6\u8c03\u6574\u4e3a UTF-8\u3002<\/p>\n\n\n\n<p class=\"has-medium-font-size\"><em>\u9488\u5bf9 powershell<\/em><\/p>\n\n\n\n<p>\u4ee5\u7ba1\u7406\u5458\u542f\u52a8 powershell\uff0c\u6267\u884c<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code>New-Item $PROFILE -ItemType File -Force<\/code><\/pre>\n\n\n\n<p>\u5728 powershell \u7684\u9ed8\u8ba4\u542f\u52a8\u76ee\u5f55\u4e0b\u521b\u5efa\u542f\u52a8\u811a\u672c %USERPROFILE%\\Documents\\WindowsPowerShell\\Microsoft.PowerShell_profile.ps1\uff0c\u518d\u6267\u884c\u547d\u4ee4<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code>Set-ExecutionPolicy Unrestricted<\/code><\/pre>\n\n\n\n<p>\u4e00\u5b9a\u8981\u7ba1\u7406\u5458\u624d\u80fd\u6267\u884c\u3002\u8fd9\u4e2a\u547d\u4ee4\u5141\u8bb8 powershell \u542f\u52a8\u7684\u65f6\u5019\u6267\u884c\u542f\u52a8\u811a\u672c\uff0c\u5982\u679c\u4e0d\u6267\u884c\u8be5\u547d\u4ee4\u4f1a\u5728\u542f\u52a8 powershell \u7684\u65f6\u5019\u63d0\u793a\u7981\u6b62\u8fd0\u884c\u811a\u672c\u3002<\/p>\n\n\n\n<p>\u7f16\u8f91\u542f\u52a8\u811a\u672c  Microsoft.PowerShell_profile.ps1\uff0c\u6dfb\u52a0\u4e00\u884c\u5185\u5bb9<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code>$OutputEncoding = [console]::InputEncoding = [console]::OutputEncoding = New-Object System.Text.UTF8Encoding<\/code><\/pre>\n\n\n\n<p>\u4ee5\u540e\u542f\u52a8 powershell \u9ed8\u8ba4\u4f7f\u7528 65001\uff08UTF-8\uff09\u5b57\u7b26\u96c6\u3002<\/p>\n","protected":false},"excerpt":{"rendered":"<p>win10\u81ea\u5e262\u4e2a\u547d\u4ee4\u884c\u5de5\u5177\uff0ccmd \u548c powershell\uff0c\u9ed8\u8ba4\u5b57\u7b26\u96c6 93 &hellip; <a href=\"http:\/\/blog.ohmmx.com\/?p=53\">\u7ee7\u7eed\u9605\u8bfb <span class=\"meta-nav\">&rarr;<\/span><\/a><\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"closed","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[21],"tags":[20,19],"class_list":["post-53","post","type-post","status-publish","format-standard","hentry","category-21","tag-20","tag-19"],"_links":{"self":[{"href":"http:\/\/blog.ohmmx.com\/index.php?rest_route=\/wp\/v2\/posts\/53","targetHints":{"allow":["GET"]}}],"collection":[{"href":"http:\/\/blog.ohmmx.com\/index.php?rest_route=\/wp\/v2\/posts"}],"about":[{"href":"http:\/\/blog.ohmmx.com\/index.php?rest_route=\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"http:\/\/blog.ohmmx.com\/index.php?rest_route=\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"http:\/\/blog.ohmmx.com\/index.php?rest_route=%2Fwp%2Fv2%2Fcomments&post=53"}],"version-history":[{"count":2,"href":"http:\/\/blog.ohmmx.com\/index.php?rest_route=\/wp\/v2\/posts\/53\/revisions"}],"predecessor-version":[{"id":58,"href":"http:\/\/blog.ohmmx.com\/index.php?rest_route=\/wp\/v2\/posts\/53\/revisions\/58"}],"wp:attachment":[{"href":"http:\/\/blog.ohmmx.com\/index.php?rest_route=%2Fwp%2Fv2%2Fmedia&parent=53"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"http:\/\/blog.ohmmx.com\/index.php?rest_route=%2Fwp%2Fv2%2Fcategories&post=53"},{"taxonomy":"post_tag","embeddable":true,"href":"http:\/\/blog.ohmmx.com\/index.php?rest_route=%2Fwp%2Fv2%2Ftags&post=53"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}