{"id":733,"date":"2012-11-19T11:46:44","date_gmt":"2012-11-19T03:46:44","guid":{"rendered":"http:\/\/newbiecoder.0ginr.com\/blog\/?p=733"},"modified":"2012-11-20T22:05:42","modified_gmt":"2012-11-20T14:05:42","slug":"%e4%b8%ba-putty-%e5%a2%9e%e5%8a%a0-cp936-gbk-%e6%94%af%e6%8c%81","status":"publish","type":"post","link":"https:\/\/newbiecoder.0ginr.com\/blog\/?p=733","title":{"rendered":"\u4e3a putty \u589e\u52a0 CP936 \/ GBK \u652f\u6301"},"content":{"rendered":"<p>\u5176\u5b9e\u5c31\u7b97\u589e\u52a0\u4e86 CP936 \u4e4b\u540e\uff0c\u95ee\u9898\u8fd8\u662f\u633a\u591a\u2026\u2026\u5404\u79cd\u5220\u9664\u534a\u4e2a\u6c49\u5b57\u3002<\/p>\n<p><strong>\u6587\u4ef6 window.c<\/strong><\/p>\n<p>\u51fd\u6570 static void init_fonts(int pick_width, int pick_height)\uff1a<br \/>\n\u6ce8\u91ca\u6389\uff1a<br \/>\n<pre><code class=\"preserve-code-formatting\">  GetCPInfo(ucsdata.font_codepage, &amp;cpinfo);\n  ucsdata.dbcs_screenfont = (cpinfo.MaxCharSize &gt; 1);<\/code><\/pre><\/p>\n<p><strong>\u6587\u4ef6 winucs.c<\/strong><\/p>\n<p>\u6570\u7ec4 static const struct cp_list_item cp_list[]\uff1a<br \/>\n\u589e\u52a0\uff1a<br \/>\n<code class=\"preserve-code-formatting\">  {&quot;CP936&quot;, 936},<\/code><\/p>\n<p>\u51fd\u6570\uff1avoid init_ucs(Config *cfg, struct unicode_data *ucsdata)\uff1a<br \/>\n\u5728\u4ee3\u7801\u6bb5\uff1a<br \/>\n<pre><code class=\"preserve-code-formatting\">    \/* Decide on the Line and Font codepages *\/\n    ucsdata-&gt;line_codepage = decode_codepage(cfg-&gt;line_codepage);<\/code><\/pre>\u4e4b\u540e\u63d2\u5165\uff1a<br \/>\n<pre><code class=\"preserve-code-formatting\">  if (ucsdata-&gt;line_codepage &gt; 0) {\n    ucsdata-&gt;font_codepage = ucsdata-&gt;line_codepage;\n  }\n  \n  {\n    CPINFO cpinfo;\n    GetCPInfo(ucsdata-&gt;font_codepage, &amp;cpinfo);\n    ucsdata-&gt;dbcs_screenfont = (cpinfo.MaxCharSize &gt; 1);\n  }<\/code><\/pre><\/p>\n","protected":false},"excerpt":{"rendered":"<p>\u5176\u5b9e\u5c31\u7b97\u589e\u52a0\u4e86 CP936 \u4e4b\u540e\uff0c\u95ee\u9898\u8fd8\u662f\u633a\u591a\u2026\u2026\u5404\u79cd\u5220\u9664\u534a\u4e2a\u6c49\u5b57\u3002 \u6587\u4ef6 window.c \u51fd\u6570 stati [&hellip;]<\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"open","ping_status":"closed","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[1],"tags":[],"class_list":["post-733","post","type-post","status-publish","format-standard","hentry","category-1"],"_links":{"self":[{"href":"https:\/\/newbiecoder.0ginr.com\/blog\/index.php?rest_route=\/wp\/v2\/posts\/733","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/newbiecoder.0ginr.com\/blog\/index.php?rest_route=\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/newbiecoder.0ginr.com\/blog\/index.php?rest_route=\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/newbiecoder.0ginr.com\/blog\/index.php?rest_route=\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/newbiecoder.0ginr.com\/blog\/index.php?rest_route=%2Fwp%2Fv2%2Fcomments&post=733"}],"version-history":[{"count":10,"href":"https:\/\/newbiecoder.0ginr.com\/blog\/index.php?rest_route=\/wp\/v2\/posts\/733\/revisions"}],"predecessor-version":[{"id":744,"href":"https:\/\/newbiecoder.0ginr.com\/blog\/index.php?rest_route=\/wp\/v2\/posts\/733\/revisions\/744"}],"wp:attachment":[{"href":"https:\/\/newbiecoder.0ginr.com\/blog\/index.php?rest_route=%2Fwp%2Fv2%2Fmedia&parent=733"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/newbiecoder.0ginr.com\/blog\/index.php?rest_route=%2Fwp%2Fv2%2Fcategories&post=733"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/newbiecoder.0ginr.com\/blog\/index.php?rest_route=%2Fwp%2Fv2%2Ftags&post=733"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}