{"id":4137,"date":"2016-08-24T11:29:24","date_gmt":"2016-08-24T03:29:24","guid":{"rendered":"http:\/\/blog.qdac.cc\/?p=4137"},"modified":"2016-08-25T22:14:25","modified_gmt":"2016-08-25T14:14:25","slug":"qstring-%e5%85%b3%e4%ba%8e%e6%96%b0%e5%a2%9e%e7%9a%84-javaescape-%e5%92%8c-javaunescape-%e5%87%bd%e6%95%b0%e8%af%b4%e6%98%8e","status":"publish","type":"post","link":"https:\/\/blog.qdac.cc\/?p=4137","title":{"rendered":"[QString] \u5173\u4e8e\u65b0\u589e\u7684 JavaEscape \u548c JavaUnescape \u51fd\u6570\u8bf4\u660e"},"content":{"rendered":"<p>QString \u65b0\u589e\u4e86\u4e24\u4e2a\u51fd\u6570 JavaEscape \u548c JavaUnescape \u6765\u5904\u7406\u5b57\u7b26\u4e32\u7684\u8f6c\u4e49\u3002\u5b9e\u9645\u4e0a\uff0c\u5b83\u7684\u8f6c\u4e49\u89c4\u5219\u548c C++\/C# \u57fa\u672c\u4e00\u81f4\uff0c\u6240\u4ee5\u540c\u6837\u7684\u5904\u7406\u4e5f\u9002\u5e94\u4e8e C++\/C# \u51fd\u6570\u3002<\/p>\n<p>\u76ee\u524d\u8be5\u51fd\u6570\u652f\u6301\u7684\u8f6c\u4e49\u5e8f\u5217\u5305\u62ec\uff1a<\/p>\n<ul>\n<li>ASCII \u7801 7 \u81f3 13 \u5bf9\u5e94\u7684\u8f6c\u4e49\u7b26\uff0c\u5206\u522b\u662f\uff1a<br \/>\n7 -&gt; \\a<br \/>\n8 -&gt; \\b<br \/>\n9 -&gt; \\t<br \/>\n10 -&gt; \\n<br \/>\n11 -&gt; \\v<br \/>\n12 -&gt; \\f<br \/>\n13 -&gt; \\r<\/li>\n<li>\u7279\u6b8a\u5b57\u7b26\uff1a<br \/>\n\\ -&gt; \\\\<br \/>\n&#8216; -&gt; \\&#8217;<br \/>\n&#8221; -&gt; \\&#8221;<\/li>\n<li>\u9664\u7a7a\u683c\uff08ASCII \u7801 32\uff09 \u5230 ~ \u4e4b\u95f4\u7684\u6240\u6709\u5b57\u7b26\uff0c\u5982\u679c\u6307\u5b9a ADoEscape \u4e3a true \u65f6\uff0c\u4f1a\u8f6c\u4e49\u4e3a \\uHHHH \u7684\u5341\u516d\u8fdb\u5236 Unicode \u5185\u7801\u8868\u793a<\/li>\n<\/ul>\n<p>\u76f8\u6bd4\u8f6c\u4e49\uff0c JavaUnescape \u989d\u5916\u652f\u6301\uff1a<\/p>\n<ul>\n<li>\\? \u4f1a\u8f6c\u4e49\u4e3a ?<\/li>\n<li>\\xHH \u4f1a\u8f6c\u4e49\u4e3a\u5341\u8fdb\u5236 HH \u5bf9\u5e94\u7684\u5b57\u7b26<\/li>\n<li>\\UHHHHHHHH \u4f1a\u8f6c\u4e49\u4e3a\u5341\u516d\u8fdb\u5236\u00a0HHHHHHHH\u00a0\u6240\u5bf9\u5e94\u7684\u5b57\u7b26\uff08\u4e00\u822c\u662f\u6269\u5c55\u533a\u5b57\u7b26\uff0cC# \u89c4\u5219\u5bf9\u5e940x10000~0x1FFFF\u4e4b\u95f4\u7684\u5b57\u7b26\uff0cJavaUnescape \u4e0d\u5bf9\u8303\u56f4\u8fdb\u884c\u68c0\u67e5\uff09<\/li>\n<li>\\OOO \u4f1a\u8f6c\u4e49\u4e3a\u516b\u8fdb\u5236 OOO \u6240\u5bf9\u5e94\u7684\u5b57\u7b26\uff0c\u5176\u4e2d\u6570\u5b57\u6700\u591a3\u4e2a\u4e0d\u8d85\u8fc77\u7684\u6570\u5b57\uff0c\u7b2c\u4e00\u4e2a\u4e0d\u8d85\u8fc73<\/li>\n<li>\u5982\u679c\u542f\u7528 AStrictEscape \u9650\u5236\uff0c\u5219\u65e0\u6548\u7684\u8f6c\u4e49\u5e8f\u5217\u4f1a\u629b\u51fa\u5f02\u5e38\uff0c\u5982\u679c\u4e0d\u542f\u7528\uff0c\u5219\u4f1a\u5ffd\u7565\u6389\u8f6c\u4e49\u7b26\uff0c\u4f8b\u5982\uff1a<br \/>\n\\joke \u4f1a\u88ab\u8f6c\u6362\u4e3a joke \uff0c\u800c\u4e0d\u662f \\joke<\/li>\n<\/ul>\n","protected":false},"excerpt":{"rendered":"<p>QString \u65b0\u589e\u4e86\u4e24\u4e2a\u51fd\u6570 Java [&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":[69,8],"tags":[31,164,223],"class_list":["post-4137","post","type-post","status-publish","format-standard","hentry","category-c-builder","category-delphi","tag-c","tag-java","tag-223"],"views":3439,"_links":{"self":[{"href":"https:\/\/blog.qdac.cc\/index.php?rest_route=\/wp\/v2\/posts\/4137","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=4137"}],"version-history":[{"count":4,"href":"https:\/\/blog.qdac.cc\/index.php?rest_route=\/wp\/v2\/posts\/4137\/revisions"}],"predecessor-version":[{"id":4150,"href":"https:\/\/blog.qdac.cc\/index.php?rest_route=\/wp\/v2\/posts\/4137\/revisions\/4150"}],"wp:attachment":[{"href":"https:\/\/blog.qdac.cc\/index.php?rest_route=%2Fwp%2Fv2%2Fmedia&parent=4137"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/blog.qdac.cc\/index.php?rest_route=%2Fwp%2Fv2%2Fcategories&post=4137"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/blog.qdac.cc\/index.php?rest_route=%2Fwp%2Fv2%2Ftags&post=4137"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}