{"id":172,"date":"2009-01-01T10:03:00","date_gmt":"2009-01-01T02:03:00","guid":{"rendered":""},"modified":"2013-11-18T21:43:34","modified_gmt":"2013-11-18T13:43:34","slug":"delphi%e7%b9%81%e7%ae%80%e8%bd%ac%e6%8d%a2%e6%ba%90%e7%a0%81%e5%87%bd%e6%95%b0","status":"publish","type":"post","link":"https:\/\/kyle.ai\/blog\/172.html","title":{"rendered":"Delphi\u7e41\u7b80\u8f6c\u6362\u6e90\u7801\u51fd\u6570"},"content":{"rendered":"<pre class=\"brush: delphi; title: ; notranslate\" title=\"\">\r\nFunction GBCht2Chs(GBStr: String): AnsiString;\r\n{\u8fdb\u884cGBK\u7e41\u4f53\u8f6c\u7b80\u4f53}\r\nVar\r\nLen: integer;\r\npGBCHTChar: PChar;\r\npGBCHSChar: PChar;\r\nBegin\r\npGBCHTChar := PChar(GBStr);\r\nLen := MultiByteToWideChar(936, 0, pGBCHTChar, -1, Nil, 0);\r\nGetMem(pGBCHSChar, Len * 2 + 1);\r\nZeroMemory(pGBCHSChar, Len * 2 + 1);\r\nLCMapString($804, LCMAP_SIMPLIFIED_CHINESE, pGBCHTChar, -1, pGBCHSChar, Len * 2);\r\nresult := String(pGBCHSChar);\r\nFreeMem(pGBCHSChar);\r\nEnd;\r\n\r\nFunction GBChs2Cht(GBStr: String): AnsiString;\r\n{\u8fdb\u884cGBK\u7b80\u4f53\u8f6c\u7e41\u4f53}\r\nVar\r\nLen: integer;\r\npGBCHTChar: PChar;\r\npGBCHSChar: PChar;\r\nBegin\r\npGBCHSChar := PChar(GBStr);\r\nLen := MultiByteToWideChar(936, 0, pGBCHSChar, -1, Nil, 0);\r\nGetMem(pGBCHTChar, Len * 2 + 1);\r\nZeroMemory(pGBCHTChar, Len * 2 + 1);\r\nLCMapString($804, LCMAP_TRADITIONAL_CHINESE, pGBCHSChar, -1, pGBCHTChar, Len * 2);\r\nresult := String(pGBCHTChar);\r\nFreeMem(pGBCHTChar);\r\nEnd;\r\n\r\nMemo1.text:=GBChs2Cht(Memo1.text);   \/\/\u7b80\u4f53\u8f6c\u7e41\u4f53\r\n\r\nMemo1.text:=GBCht2Chs(Memo1.text); \/\/\u7e41\u4f53\u8f6c\u7b80\u4f53\r\n<\/pre>\n","protected":false},"excerpt":{"rendered":"<p>Function GBCht2Chs(GBStr: String): AnsiString; {\u8fdb\u884cGBK\u7e41\u4f53 [&hellip;]<\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[6],"tags":[],"class_list":["post-172","post","type-post","status-publish","format-standard","hentry","category-code_related"],"_links":{"self":[{"href":"https:\/\/kyle.ai\/blog\/wp-json\/wp\/v2\/posts\/172","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/kyle.ai\/blog\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/kyle.ai\/blog\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/kyle.ai\/blog\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/kyle.ai\/blog\/wp-json\/wp\/v2\/comments?post=172"}],"version-history":[{"count":1,"href":"https:\/\/kyle.ai\/blog\/wp-json\/wp\/v2\/posts\/172\/revisions"}],"predecessor-version":[{"id":4807,"href":"https:\/\/kyle.ai\/blog\/wp-json\/wp\/v2\/posts\/172\/revisions\/4807"}],"wp:attachment":[{"href":"https:\/\/kyle.ai\/blog\/wp-json\/wp\/v2\/media?parent=172"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/kyle.ai\/blog\/wp-json\/wp\/v2\/categories?post=172"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/kyle.ai\/blog\/wp-json\/wp\/v2\/tags?post=172"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}