{"id":271978,"date":"2021-01-11T18:20:18","date_gmt":"2021-01-11T10:20:18","guid":{"rendered":"http:\/\/4563.org\/?p=271978"},"modified":"2021-01-11T18:20:18","modified_gmt":"2021-01-11T10:20:18","slug":"%e4%bd%bf%e7%94%a8%e5%8f%af%e5%8f%98%e9%95%bf%e5%ba%a6%e7%bc%96%e7%a0%81%e4%bd%9c%e4%b8%ba%e5%86%85%e9%83%a8%e5%bd%a2%e5%bc%8f%e7%9a%84%e5%ad%97%e7%ac%a6%e4%b8%b2%ef%bc%8c%e5%a6%82%e4%bd%95%e5%ae%9e","status":"publish","type":"post","link":"http:\/\/4563.org\/?p=271978","title":{"rendered":"\u4f7f\u7528\u53ef\u53d8\u957f\u5ea6\u7f16\u7801\u4f5c\u4e3a\u5185\u90e8\u5f62\u5f0f\u7684\u5b57\u7b26\u4e32\uff0c\u5982\u4f55\u5b9e\u73b0\u8bbf\u95ee\u67d0\u4e2a\u5177\u4f53\u4f4d\u7f6e\u7684\u5b57\u7b26\uff1f"},"content":{"rendered":"<div>\n<div>\n<div>\n<h1>                  \u4f7f\u7528\u53ef\u53d8\u957f\u5ea6\u7f16\u7801\u4f5c\u4e3a\u5185\u90e8\u5f62\u5f0f\u7684\u5b57\u7b26\u4e32\uff0c\u5982\u4f55\u5b9e\u73b0\u8bbf\u95ee\u67d0\u4e2a\u5177\u4f53\u4f4d\u7f6e\u7684\u5b57\u7b26\uff1f               <\/h1>\n<p> <\/p>\n<div>\n<div> <span>\u8cc7\u6df1\u5927\u4f6c : usamoi <\/span>  <span><i><\/i> 2<\/span> <\/div>\n<div> <\/div>\n<\/p><\/div>\n<\/p><\/div>\n<\/p><\/div>\n<div isfirst=\"1\"> <\/p>\n<p>\u6211\u5728\u7f16\u5199\u4e00\u4e2a\u4e0d\u53ef\u53d8 String \u7684\u8f6e\u5b50\uff0c\u9762\u5411\u5904\u7406\u4e2d\u6587\u6587\u672c\u8f83\u591a\u7684\u73af\u5883\uff0c\u5e0c\u671b\u80fd\u51cf\u5c11\u4f7f\u7528\u8005\u7684\u5fc3\u667a\u8d1f\u62c5\u3002\u76ee\u524d\u8ba1\u5212\u4f7f\u7528 UTF-16 \u4f5c\u4e3a\u5b57\u7b26\u4e32\u7684\u5185\u90e8\u8868\u793a\uff0c\u7531\u4e8e UTF-16 \u662f\u53d8\u957f\u7f16\u7801\uff0c\u53d6\u5f97\u67d0\u4e2a\u4f4d\u7f6e\u4e0a\u7684 Unicode Character \u8fd9\u4e2a\u51fd\u6570\u4e0d\u6613\u5b9e\u73b0\u3002\u5355\u4e2a Unicode Character \u53ef\u80fd\u5360\u7528 1 \u4e2a Unicode Code Unit\uff0c\u4e5f\u53ef\u80fd\u5360\u7528 2 \u4e2a Unicode Code Unit\uff0c\u7b2c k \u4e2a Unicode Code Unit \u4e0d\u4e00\u5b9a\u5bf9\u5e94\u7b2c k \u4e2a Unicode Character \u3002<\/p>\n<p>\u4e0b\u9762\u662f\u6211\u76ee\u524d\u60f3\u5230\u7684\u51e0\u4e2a\u89e3\u51b3\u65b9\u6848\uff1a<\/p>\n<ul>\n<li>\n<p>\u907f\u514d\u95ee\u9898\u3002\u6539\u6362 UTF-32 \u4f5c\u4e3a\u5185\u90e8\u8868\u793a\u3002\u65e5\u5e38\u573a\u666f\u4e2d\u53ea\u65b9\u4fbf\u4e86 emoji \u7684\u5904\u7406\uff0c\u4f46\u662f\u8fd9\u4e5f\u5e76\u4e0d\u5b8c\u5168\uff0c\u56e0\u4e3a\u4e00\u90e8\u5206 emoji \u53c8\u9700\u8981\u751a\u81f3 3 \u4e2a Unicode Character \u624d\u80fd\u8868\u793a\u51fa\u6765\uff0c\u4f9d\u7136\u9700\u8981\u624b\u5de5\u5904\u7406\uff0c\u6240\u4ee5\u5c24\u5176\u6ed1\u7a3d\u3002<\/p>\n<\/li>\n<li>\n<p>\u8f6c\u79fb\u77db\u76fe\u3002\u548c String \u914d\u5957\u7684 Character\uff0c\u8868\u793a\u80fd\u529b\u4ece Unicode Character \u7f29\u5c0f\u5230 Unicode Code Unit \u3002\u8981\u6c42\u4f7f\u7528\u8005\u81ea\u884c\u5904\u7406\u9700\u8981 2 \u4e2a Unicode Code Unit \u8868\u793a\u7684\u5b57\u7b26\u3002\u8fd9\u4e5f\u662f.NET \u7684\u65b9\u6848\u3002<\/p>\n<\/li>\n<li>\n<p>\u52a0\u901f\u987a\u5e8f\u8bbf\u95ee\u7684\u4e00\u4e2a\u7b56\u7565\u3002\u8bb0\u5f55\u4e0a\u4e00\u6b21\u8bbf\u95ee\u7684 Code Unit \u4f4d\u7f6e\u548c Character \u4f4d\u7f6e\uff0c\u7528\u6765\u52a0\u901f\u4e0b\u4e00\u6b21\u8bbf\u95ee\u3002\u4e3a\u4e86\u5bf9\u5e76\u884c\u53cb\u597d\uff0c\u8fd8\u9700\u8981\u5199\u4e00\u4e2a StringAccessor \u6765\u5b58\u50a8\u8fd9\u4e24\u9879\uff0c\u5e76\u4e14\u7531\u5b83\u95f4\u63a5\u8bbf\u95ee String\uff0c\u4ee5\u514d\u4e0d\u540c\u7ebf\u7a0b\u8bbf\u95ee\u540c\u4e00\u5b57\u7b26\u4e32\u65f6\u8fd9\u4e00\u52a0\u901f\u5931\u6548\u3002<\/p>\n<\/li>\n<li>\n<p>\u52a0\u901f\u968f\u673a\u8bbf\u95ee\u7684\u4e00\u4e2a\u7b56\u7565\u3002\u5c06\u5b57\u7b26\u4e32\u5747\u5300\u5206\u4e3a$O(sqrt{n})$\u6bb5\uff0c\u9884\u5904\u7406\u6bcf\u4e00\u6bb5\u7684 Character \u6570\u548c\u6bcf\u4e00\u6bb5\u7684 Code Unit \u6570\u76ee\uff0c\u968f\u673a\u8bbf\u95ee\u7684\u65f6\u95f4\u590d\u6742\u5ea6\u4e3a$O(sqrt{n})$\uff0c\u5355\u4e2a\u5b57\u7b26\u4e32\u9700\u8981$O(sqrt{n})$\u7684\u9644\u52a0\u7a7a\u95f4\uff0c\u4ee3\u4ef7\u4f9d\u7136\u5f88\u6602\u8d35\u3002<\/p>\n<\/li>\n<\/ul>\n<p>\u8fd9\u4e2a\u600e\u4e48\u6574\u554a\u256e(\u256f\u25bd\u2570)\u256d<\/p>\n<\/p><\/div>\n<div> <b>\u5927\u4f6c\u6709\u8a71\u8aaa<\/b> (<span>4<\/span>)        <\/div>\n<div> <\/div>\n<\/p><\/div>\n<\/p><\/div>\n<ul>\n<li data-pid=\"4899075\" data-uid=\"2\">\n<div>\n<div>\n<div> <span>\u8cc7\u6df1\u5927\u4f6c : msg7086 <\/span>  <\/div>\n<div> <i title=\"\u5f15\u7528\"><\/i>  <span>          <\/span> <\/div>\n<\/p><\/div>\n<div>                                                             \u8981\u81ea\u5df1\u625b\u7684\u8bdd\u53ef\u4ee5\u8003\u8651\u52a0\u7d22\u5f15\u3002<br \/>\u6bd4\u5982\u6bcf 128 \u5b57\u7b26\u8bb0\u4e00\u4e2a\u4e0b\u6807\uff0c\u8fd9\u6837\u6bcf\u6b21\u5bfb\u5740\u6700\u591a\u53ea\u9700\u8981\u68c0\u67e5 127 \u4e2a\u5b57\u7b26\uff0c\u548c\u4f60\u7684#4 \u7c7b\u4f3c\u3002<br \/>sqrt(n)\u662f\u4e00\u4e2a\u5f88\u4e0d\u6602\u8d35\u7684\u64cd\u4f5c\u4e86\uff0c\u989d\u5916\u7684\u7a7a\u95f4\u548c\u65f6\u95f4\u57fa\u672c\u53ef\u4ee5\u5ffd\u7565\u4e0d\u8ba1\u3002<br \/>\u8981\u4fbf\u6377\u6027\u603b\u8981\u6709\u727a\u7272\u7684\u3002                                                            <\/div>\n<\/p><\/div>\n<\/li>\n<li data-pid=\"4899076\" data-uid=\"2\">\n<div>\n<div>\n<div> <span>\u8cc7\u6df1\u5927\u4f6c : gyf304 <\/span>  <\/div>\n<div> <i title=\"\u5f15\u7528\"><\/i>  <span>          <\/span> <\/div>\n<\/p><\/div>\n<div>                                                             \u5efa\u8bae\u4e0d\u8981\u81ea\u5df1\u5f04\u3002\u7528 ICU<br \/>http:\/\/site.icu-project.org\/home                                                            <\/div>\n<\/p><\/div>\n<\/li>\n<li data-pid=\"4899077\" data-uid=\"2\">\n<div>\n<div>\n<div> <span>\u8cc7\u6df1\u5927\u4f6c : agagega <\/span>  <\/div>\n<div> <i title=\"\u5f15\u7528\"><\/i>  <span>          <\/span> <\/div>\n<\/p><\/div>\n<div>                                                             \u53ef\u4ee5\u52a0\u901f\uff0c\u4f46\u6982\u5ff5\u4e0a String \u548c Bytes \u5c31\u4e0d\u662f\u4e00\u4e2a\u4e1c\u897f\uff0cString \u53ef\u4ee5\u5f53\u4f5c\u4e00\u4e2a\u65e0\u6cd5\u968f\u673a\u8bbf\u95ee\u7684\u4e1c\u897f                                                            <\/div>\n<\/p><\/div>\n<\/li>\n<li data-pid=\"4899078\" data-uid=\"2\">\n<div>\n<div>\n<div> <span>\u8cc7\u6df1\u5927\u4f6c : lxilu <\/span>  <\/div>\n<div> <i title=\"\u5f15\u7528\"><\/i>  <span>          <\/span> <\/div>\n<\/p><\/div>\n<div>                                                             \u6709 UTF-X Code Unit<br \/>\u6ca1\u6709 Unicode Code Unit                                                            <\/div>\n<\/p><\/div>\n<\/li>\n<li>\n","protected":false},"excerpt":{"rendered":"<p>\u4f7f\u7528\u53ef\u53d8\u957f\u5ea6\u7f16\u7801\u4f5c\u4e3a\u5185\u90e8\u5f62\u5f0f\u7684\u5b57\u7b26&hellip;<\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":[],"categories":[],"tags":[],"_links":{"self":[{"href":"http:\/\/4563.org\/index.php?rest_route=\/wp\/v2\/posts\/271978"}],"collection":[{"href":"http:\/\/4563.org\/index.php?rest_route=\/wp\/v2\/posts"}],"about":[{"href":"http:\/\/4563.org\/index.php?rest_route=\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"http:\/\/4563.org\/index.php?rest_route=\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"http:\/\/4563.org\/index.php?rest_route=%2Fwp%2Fv2%2Fcomments&post=271978"}],"version-history":[{"count":0,"href":"http:\/\/4563.org\/index.php?rest_route=\/wp\/v2\/posts\/271978\/revisions"}],"wp:attachment":[{"href":"http:\/\/4563.org\/index.php?rest_route=%2Fwp%2Fv2%2Fmedia&parent=271978"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"http:\/\/4563.org\/index.php?rest_route=%2Fwp%2Fv2%2Fcategories&post=271978"},{"taxonomy":"post_tag","embeddable":true,"href":"http:\/\/4563.org\/index.php?rest_route=%2Fwp%2Fv2%2Ftags&post=271978"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}