{"id":3400,"date":"2016-01-06T16:48:48","date_gmt":"2016-01-06T08:48:48","guid":{"rendered":"http:\/\/blog.qdac.cc\/?p=3400"},"modified":"2016-01-07T08:56:53","modified_gmt":"2016-01-07T00:56:53","slug":"c-c-builder-%e4%b8%ad-ansi-%e7%bc%96%e7%a0%81%e7%9a%84%e5%ad%97%e7%ac%a6%e4%b8%b2%e5%9c%a8androidios%e7%a8%8b%e5%ba%8f%e4%b8%ad%e6%98%be%e7%a4%ba%e7%9a%84%e9%97%ae%e9%a2%98","status":"publish","type":"post","link":"https:\/\/blog.qdac.cc\/?p=3400","title":{"rendered":"[C++] C++ Builder \u4e2d Ansi \u7f16\u7801\u7684\u5b57\u7b26\u4e32\u5728Android\/iOS\u7a0b\u5e8f\u4e2d\u663e\u793a\u7684\u95ee\u9898"},"content":{"rendered":"<p>\u5443\uff0c\u8fd9\u4e2a\u95ee\u9898\u8bf4\u8d77\u6765\uff0c\u5176\u5b9e\u4e5f\u4e0d\u9ebb\u70e6\uff0cC++ Builder \u672c\u8eab\u5728 TEncoding \u505a\u4e86\u5904\u7406\uff0c\u4f46\u662f\uff0c\u53ef\u80fd\u7528\u8d77\u6765\u8fd8\u662f\u4e0d\u591f\u8212\u670d\uff0c\u6bd5\u7adf Delphi \u7684 TBytes \u5728 C++ Builder \u91cc\u7528\uff0c\u8fd8\u662f\u611f\u89c9\u602a\u602a\u7684\u3002<\/p>\n<p>\u4e0d\u8fc7\uff0c\u53ef\u4ee5\u544a\u8bc9\u5927\u5bb6\u4e00\u4e2a\u597d\u6d88\u606f\uff0cAnsiString \u5728 Delphi \u4e2d\u867d\u7136\u4e0d\u53ef\u7528\uff0c\u4f46\u662f\uff0c\u5728 C++ \u4e2d\u53ef\u4ee5\u7528\u3002\u53ea\u7528 Delphi \u7684\u670b\u53cb\u662f\u5426\u6709\u4e00\u79cd\u7fa1\u6155\u3001\u5ac9\u5992\u3001\u6068\u7684\u611f\u89c9\uff0c\u5b9e\u5728\u60f3\u7528\uff0cAndy \u63d0\u4f9b\u4e86\u4e00\u4e2a\u4fee\u6539\u7cfb\u7edf dcu \u7684\u65b9\u6cd5\uff0c\u4e0d\u8fc7\u4e0d\u592a\u5efa\u8bae\uff0c\u6bd5\u7adf\u4e0d\u662f\u5b98\u65b9\u652f\u6301\u3002<\/p>\n<p>\u63a5\u4e0b\u6765\uff0c\u544a\u8bc9\u5927\u5bb6\u4e00\u4e2a\u574f\u6d88\u606f\uff0c\u4f60\u6307\u671b AnsiString \u76f4\u63a5\u8d4b\u503c\u7ed9\u4e00\u4e2a UnicodeString \uff0c\u7136\u540e\u663e\u793a\u51fa\u6765\u7684\u68a6\u5728\u8de8\u5e73\u53f0\u7684\u60c5\u51b5\u4e0b\u662f\u4e0d\u6210\u7acb\u7684\u3002<\/p>\n<p>\u4e0d\u8fc7\uff0c\u4f60\u8981\u6ce8\u610f\u4e00\u4e0b\uff0cC++ Builder \u4e2d AnsiString \u5b9e\u9645\u4e0a\u662f typedef \u00a0AnsiStringT&lt;0&gt; AnsiString; \u65f6\uff0c\u4f60\u662f\u4e0d\u662f\u611f\u89c9\u627e\u5230\u4e86\u5565\u6307\u8def\u660e\u706f\uff1f<\/p>\n<p>\u95ee\u9898\u5c31\u51fa\u5728\u8fd9\u4e2aAnsiStringT&lt;0&gt; \u4e0a\uff0c0 \u5728 Windows \u4e0b\u5bf9\u5e94\u7684\u662fCP_ACP\uff0c\u662f\u64cd\u4f5c\u7cfb\u7edf\u7684\u9ed8\u8ba4\u4ee3\u7801\u9875\uff0c\u800c Android \u548c iOS \u4e0a\u9ed8\u8ba4\u7684\u4ee3\u7801\u9875\u5e76\u4e0d\u662f 936\uff0c\u6240\u4ee5\u4e2d\u6587\u663e\u793a\u4f1a\u51fa\u95ee\u9898\u3002<\/p>\n<p>\u7ee7\u7eed\uff0c\u662f\u4e0d\u662f\u80fd\u627e\u5230\u601d\u8def\u4e86\uff0c\u6211\u4eec\u8fd9\u6837\u5199\u5c31OK\u4e86\uff1a<\/p>\n<blockquote><p>AnsiStringT&lt;936&gt; S=&#8221;\u8fd9\u662fAnsi\u7f16\u7801\u7684\u5b57\u7b26\u4e32&#8221;;<\/p><\/blockquote>\n<p>\u7136\u540e\u4f60\u4f1a\u53d1\u73b0\uff0c\u7f8e\u597d\u7684\u4e2d\u6587\u53c8\u56de\u6765\u4e86\u3002<\/p>\n<p>\u597d\u4e86\uff0c\u7528 TEncoding \u7684\u8bdd\uff0cC++ \u7684\u5199\u6cd5\u66f4\u9ebb\u70e6\u4e00\u4e9b\uff0c\u8fd8\u662f\u8fd9\u4e48\u5199\u7b80\u5355\u4e00\u70b9\u70b9~~~~<\/p>\n","protected":false},"excerpt":{"rendered":"<p>\u5443\uff0c\u8fd9\u4e2a\u95ee\u9898\u8bf4\u8d77\u6765\uff0c\u5176\u5b9e\u4e5f\u4e0d\u9ebb\u70e6\uff0cC++ [&hellip;]<\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"site-sidebar-layout":"default","site-content-layout":"","ast-site-content-layout":"default","site-content-style":"default","site-sidebar-style":"default","ast-global-header-display":"","ast-banner-title-visibility":"","ast-main-header-display":"","ast-hfb-above-header-display":"","ast-hfb-below-header-display":"","ast-hfb-mobile-header-display":"","site-post-title":"","ast-breadcrumbs-content":"","ast-featured-img":"","footer-sml-layout":"","ast-disable-related-posts":"","theme-transparent-header-meta":"","adv-header-id-meta":"","stick-header-meta":"","header-above-stick-meta":"","header-main-stick-meta":"","header-below-stick-meta":"","astra-migrate-meta-layouts":"default","ast-page-background-enabled":"default","ast-page-background-meta":{"desktop":{"background-color":"var(--ast-global-color-4)","background-image":"","background-repeat":"repeat","background-position":"center center","background-size":"auto","background-attachment":"scroll","background-type":"","background-media":"","overlay-type":"","overlay-color":"","overlay-opacity":"","overlay-gradient":""},"tablet":{"background-color":"","background-image":"","background-repeat":"repeat","background-position":"center center","background-size":"auto","background-attachment":"scroll","background-type":"","background-media":"","overlay-type":"","overlay-color":"","overlay-opacity":"","overlay-gradient":""},"mobile":{"background-color":"","background-image":"","background-repeat":"repeat","background-position":"center center","background-size":"auto","background-attachment":"scroll","background-type":"","background-media":"","overlay-type":"","overlay-color":"","overlay-opacity":"","overlay-gradient":""}},"ast-content-background-meta":{"desktop":{"background-color":"var(--ast-global-color-5)","background-image":"","background-repeat":"repeat","background-position":"center center","background-size":"auto","background-attachment":"scroll","background-type":"","background-media":"","overlay-type":"","overlay-color":"","overlay-opacity":"","overlay-gradient":""},"tablet":{"background-color":"var(--ast-global-color-5)","background-image":"","background-repeat":"repeat","background-position":"center center","background-size":"auto","background-attachment":"scroll","background-type":"","background-media":"","overlay-type":"","overlay-color":"","overlay-opacity":"","overlay-gradient":""},"mobile":{"background-color":"var(--ast-global-color-5)","background-image":"","background-repeat":"repeat","background-position":"center center","background-size":"auto","background-attachment":"scroll","background-type":"","background-media":"","overlay-type":"","overlay-color":"","overlay-opacity":"","overlay-gradient":""}},"footnotes":""},"categories":[145,69,21],"tags":[31,532,533],"class_list":["post-3400","post","type-post","status-publish","format-standard","hentry","category-android","category-c-builder","category-misc","tag-c","tag-532","tag-533"],"views":3626,"_links":{"self":[{"href":"https:\/\/blog.qdac.cc\/index.php?rest_route=\/wp\/v2\/posts\/3400","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/blog.qdac.cc\/index.php?rest_route=\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/blog.qdac.cc\/index.php?rest_route=\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/blog.qdac.cc\/index.php?rest_route=\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/blog.qdac.cc\/index.php?rest_route=%2Fwp%2Fv2%2Fcomments&post=3400"}],"version-history":[{"count":2,"href":"https:\/\/blog.qdac.cc\/index.php?rest_route=\/wp\/v2\/posts\/3400\/revisions"}],"predecessor-version":[{"id":3402,"href":"https:\/\/blog.qdac.cc\/index.php?rest_route=\/wp\/v2\/posts\/3400\/revisions\/3402"}],"wp:attachment":[{"href":"https:\/\/blog.qdac.cc\/index.php?rest_route=%2Fwp%2Fv2%2Fmedia&parent=3400"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/blog.qdac.cc\/index.php?rest_route=%2Fwp%2Fv2%2Fcategories&post=3400"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/blog.qdac.cc\/index.php?rest_route=%2Fwp%2Fv2%2Ftags&post=3400"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}