{"id":191783,"date":"2020-10-25T22:56:03","date_gmt":"2020-10-25T14:56:03","guid":{"rendered":"http:\/\/4563.org\/?p=191783"},"modified":"2020-10-25T22:56:03","modified_gmt":"2020-10-25T14:56:03","slug":"gbk-%e7%94%9f%e6%88%90%e7%9a%84-base64-%e5%9c%a8-utf-8-%e4%b8%8b%e5%a6%82%e4%bd%95%e8%a7%a3%e7%a0%81","status":"publish","type":"post","link":"http:\/\/4563.org\/?p=191783","title":{"rendered":"GBK \u751f\u6210\u7684 base64 \u5728 utf-8 \u4e0b\u5982\u4f55\u89e3\u7801"},"content":{"rendered":"<div>\n<div>\n<div>\n<h1>                  GBK \u751f\u6210\u7684 base64 \u5728 utf-8 \u4e0b\u5982\u4f55\u89e3\u7801               <\/h1>\n<p> <\/p>\n<div>\n<div> <span>\u8cc7\u6df1\u5927\u4f6c : k396656156 <\/span>  <span><i><\/i> 4<\/span> <\/div>\n<div> <\/div>\n<\/p><\/div>\n<\/p><\/div>\n<\/p><\/div>\n<div isfirst=\"1\"> <\/p>\n<p>\u4f7f\u7528 imap \u8bfb\u53d6\u90ae\u4ef6\u5185\u5bb9\uff0c\u90ae\u4ef6\u5185\u5bb9\u662f GBK \u4e0b\u751f\u6210\u7684 base64\uff0c\u90ae\u4ef6\u5185\u5bb9\u51fa\u73b0\u4e2d\u6587\u7684\u65f6\u5019\u4f7f\u7528 base64_decode \u89e3\u7801\u4f1a\u4e71\u7801\u3002\u9ed8\u8ba4\u662f utf-8 \u4e0b\u6709\u4ec0\u4e48\u65b9\u5f0f\u80fd\u6b63\u786e\u7684\u89e3\u7801 GBK \u4e0b\u7684 base64 \u6216\u8005\u8f6c\u6210 utf-8 \u6a21\u5f0f<\/p>\n<\/p><\/div>\n<div> <b>\u5927\u4f6c\u6709\u8a71\u8aaa<\/b> (<span>3<\/span>)        <\/div>\n<div> <\/div>\n<\/p><\/div>\n<\/p><\/div>\n<ul>\n<li data-pid=\"4124632\" data-uid=\"2\">\n<div>\n<div>\n<div> <span>\u8cc7\u6df1\u5927\u4f6c : cxh116 <\/span>  <\/div>\n<div> <i title=\"\u5f15\u7528\"><\/i>  <span>          <\/span> <\/div>\n<\/p><\/div>\n<div>                                                             base64 \u89e3\u7801\u540e,\u518d\u7528 mb_convert_encoding \u8f6c? <\/p>\n<p>mb_convert_encoding($str, &#8220;UTF-8&#8221;, &#8220;GBK&#8221;);<\/p>\n<p>https:\/\/www.php.net\/manual\/zh\/function.mb-convert-encoding.php                                                            <\/p><\/div>\n<\/p><\/div>\n<\/li>\n<li data-pid=\"4124633\" data-uid=\"2\">\n<div>\n<div>\n<div> <span>\u8cc7\u6df1\u5927\u4f6c : qiayue <\/span>  <\/div>\n<div> <i title=\"\u5f15\u7528\"><\/i>  <span>          <\/span> <\/div>\n<\/p><\/div>\n<div>                                                             \u5148 base64_decode\uff0c\u540e gbk \u8f6c utf8                                                            <\/div>\n<\/p><\/div>\n<\/li>\n<li data-pid=\"4124634\" data-uid=\"2\">\n<div>\n<div>\n<div> <span>\u8cc7\u6df1\u5927\u4f6c : GM <\/span>  <\/div>\n<div> <i title=\"\u5f15\u7528\"><\/i>  <span>          <\/span> <\/div>\n<\/p><\/div>\n<div>                                                             $base64 = &#8220;&#8230;&#8221;;<br \/>$decoded_gbk = base64_decode($base64);<br \/>$decoded_utf8 = mb_convert_encoding($decoded_gbk, &#8216;utf8&#8217;, &#8216;gbk&#8217;);                                                            <\/div>\n<\/p><\/div>\n<\/li>\n<li>\n","protected":false},"excerpt":{"rendered":"<p>GBK \u751f\u6210\u7684 base64 \u5728 &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\/191783"}],"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=191783"}],"version-history":[{"count":0,"href":"http:\/\/4563.org\/index.php?rest_route=\/wp\/v2\/posts\/191783\/revisions"}],"wp:attachment":[{"href":"http:\/\/4563.org\/index.php?rest_route=%2Fwp%2Fv2%2Fmedia&parent=191783"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"http:\/\/4563.org\/index.php?rest_route=%2Fwp%2Fv2%2Fcategories&post=191783"},{"taxonomy":"post_tag","embeddable":true,"href":"http:\/\/4563.org\/index.php?rest_route=%2Fwp%2Fv2%2Ftags&post=191783"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}