{"id":236,"date":"2014-05-15T11:28:31","date_gmt":"2014-05-15T02:28:31","guid":{"rendered":"http:\/\/tech.eshima.info\/?p=236"},"modified":"2014-05-15T11:31:33","modified_gmt":"2014-05-15T02:31:33","slug":"charsetgb2312%e3%81%ae%e3%83%a1%e3%83%bc%e3%83%ab%e3%82%92php%e3%81%a7%e5%87%a6%e7%90%86","status":"publish","type":"post","link":"https:\/\/tech.eshima.info\/?p=236","title":{"rendered":"charset=gb2312\u306e\u30e1\u30fc\u30eb\u3092PHP\u3067\u51e6\u7406"},"content":{"rendered":"<p>\u4e2d\u56fd\u5728\u4f4f\u306e\u65e5\u672c\u4eba\u306e\u65b9\u304b\u3089<br \/>\ncharset=gb2312\uff08\u4e2d\u56fd\u8a9e\uff09\u3067\u65e5\u672c\u8a9e\u306e\u30e1\u30fc\u30eb\u304c\u6765\u3066<br \/>\nPHP\u306e\u51e6\u7406\u3067\u6587\u5b57\u5316\u3051\u304c\u767a\u751f\u3057\u305f\u306e\u3067\u5bfe\u5fdc\u3002<\/p>\n<p>GB2312\u3068\u3044\u3046\u30b3\u30fc\u30c9\u3067\u5909\u63db\u3092\u3057\u3066\u307f\u305f\u3051\u3069\u4e00\u90e8\u306e\u6587\u5b57\u304c\u5316\u3051\u3066\u3057\u307e\u3063\u305f\u3002<br \/>\nGBK\u3068\u6307\u5b9a\u3059\u308c\u3070OK\u3002<\/p>\n<pre>\r\n\/\/mb_convert_encoding($str, \"UTF-8\", \"GB2312\");\r\nmb_convert_encoding($str, \"UTF-8\", \"GBK\");\r\n<\/pre>\n<p>\u624b\u9593\u53d6\u3063\u305f\u306e\u304c\u3001\u30e1\u30fc\u30eb\u306e\u4ef6\u540d\u306e\u6587\u5b57\u5316\u3051\u3002<\/p>\n<pre>\r\nmb_decode_mimeheader($headerList['Subject']);\r\n<\/pre>\n<p>\u306e\u51e6\u7406\u3067\u65e2\u306b\u6587\u5b57\u5316\u3051\u304c\u767a\u751f\u3057\u3066\u3044\u308b\u306e\u3067<br \/>\n\u305d\u306e\u5f8c\u3067mb_convert_encoding\u3092\u3057\u3066\u3082\u76f4\u3089\u306a\u3044\u3002<\/p>\n<p>\u3088\u304f\u898b\u308b\u3068\u3001\u6700\u521d\u306bGB2312\u3067\u30b3\u30f3\u30d0\u30fc\u30c8\u3057\u3066\u3044\u305f\u306e\u3068\u540c\u7b49\u306e\u6587\u5b57\u5316\u3051\u3060\u3063\u305f\u3002<br \/>\nmb_decode_mimeheader\u3092\u304b\u3051\u308b\u524d\u3092\u898b\u3066\u307f\u308b\u3068\u3001\u3053\u306e\u6642\u70b9\u3067\u30a8\u30f3\u30b3\u30fc\u30c9\u5f62\u5f0f\u304c\u6307\u5b9a\u3055\u308c\u3066\u3044\u308b\u3088\u3046\u3002<br \/>\n=?GB2312?B?UmU6IM\u30fb\u30fb\u30fb<\/p>\n<p>\u7121\u7406\u3084\u308a\u3060\u3051\u3069\u3001<\/p>\n<pre>\r\n$headerList['Subject'] = str_replace('GB2312', 'GBK', $headerList['Subject']);\r\n<\/pre>\n<p>\u3068\u3057\u3066\u30a8\u30f3\u30b3\u30fc\u30c9\u5f62\u5f0f\u306e\u6307\u5b9a\u3092GBK\u306b\u7f6e\u304d\u63db\u3048\u305f\u3089\u76f4\u3063\u305f\u3002<\/p>\n","protected":false},"excerpt":{"rendered":"<p>\u4e2d\u56fd\u5728\u4f4f\u306e\u65e5\u672c\u4eba\u306e\u65b9\u304b\u3089 charset=gb23 [&hellip;]<\/p>\n","protected":false},"author":2,"featured_media":0,"comment_status":"open","ping_status":"closed","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[9],"tags":[],"class_list":["post-236","post","type-post","status-publish","format-standard","hentry","category-php"],"aioseo_notices":[],"_links":{"self":[{"href":"https:\/\/tech.eshima.info\/index.php?rest_route=\/wp\/v2\/posts\/236","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/tech.eshima.info\/index.php?rest_route=\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/tech.eshima.info\/index.php?rest_route=\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/tech.eshima.info\/index.php?rest_route=\/wp\/v2\/users\/2"}],"replies":[{"embeddable":true,"href":"https:\/\/tech.eshima.info\/index.php?rest_route=%2Fwp%2Fv2%2Fcomments&post=236"}],"version-history":[{"count":5,"href":"https:\/\/tech.eshima.info\/index.php?rest_route=\/wp\/v2\/posts\/236\/revisions"}],"predecessor-version":[{"id":241,"href":"https:\/\/tech.eshima.info\/index.php?rest_route=\/wp\/v2\/posts\/236\/revisions\/241"}],"wp:attachment":[{"href":"https:\/\/tech.eshima.info\/index.php?rest_route=%2Fwp%2Fv2%2Fmedia&parent=236"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/tech.eshima.info\/index.php?rest_route=%2Fwp%2Fv2%2Fcategories&post=236"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/tech.eshima.info\/index.php?rest_route=%2Fwp%2Fv2%2Ftags&post=236"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}