{"id":1442,"date":"2009-07-30T00:58:27","date_gmt":"2009-07-29T15:58:27","guid":{"rendered":"http:\/\/fukata.org\/?p=1442"},"modified":"2017-08-11T22:59:08","modified_gmt":"2017-08-11T22:59:08","slug":"php-garble-utf8-mail-subject","status":"publish","type":"post","link":"https:\/\/blog.fukata.org\/archives\/1442\/","title":{"rendered":"PHP\u3067UTF8\u306e\u30e1\u30fc\u30eb\u306e\u4ef6\u540d\u304c\u6587\u5b57\u5316\u3051\u308b\u4ef6\u306b\u3064\u3044\u3066"},"content":{"rendered":"

\u4eca\u65e5\u306f\u4e45\u3005\u306b\u306f\u307e\u3063\u3066\u3057\u307e\u3044\u307e\u3057\u305f\u3002<\/p>\n

PHP\u3067UTF8\u306e\u30e1\u30fc\u30eb\u9001\u4fe1\u51e6\u7406\u3092\u4f5c\u6210\u3057\u3066\u3044\u305f\u3093\u3067\u3059\u304c\u3001\u7279\u5b9a\u306e\u6587\u5b57\u5217\u304c\u3042\u308b\u5834\u5408\u306e\u307f\u3001\u4ef6\u540d\u304c\u6587\u5b57\u5316\u3051\u308b\u3093\u3067\u3059\u3088\u3002\u3057\u304b\u3082\u3001\u30ed\u30fc\u30ab\u30eb\u306eUbuntu\u306e\u74b0\u5883\u3067\u306f\u8d77\u304d\u305a\u3001\u30c6\u30b9\u30c8\u30b5\u30fc\u30d0\u4e0a\u3067\u306e\u307f\u767a\u751f\u3002\u3002\u3002\u3042\u3001\u30c6\u30b9\u30c8\u30b5\u30fc\u30d0\u306ePHP\u306e\u30d0\u30fc\u30b8\u30e7\u30f3\u78ba\u8a8d\u3059\u308b\u306e\u5fd8\u308c\u305f\u3002<\/p>\n

\u3067\u3001\u539f\u56e0\u306a\u3093\u3067\u3059\u304c\u3001\u3069\u3046\u3084\u3089\u300cmb_encode_mimeheader<\/a>\u300d\u304c\u539f\u56e0\u3060\u3063\u305f\u3088\u3046\u3067\u3059\u3002\u3057\u3087\u3046\u304c\u306a\u3044\u306e\u3067\u3001\u4ee5\u4e0b\u306e\u3088\u3046\u306b\u3057\u3066\u81ea\u5206\u3067\u4f5c\u6210\u3057\u307e\u3057\u305f\u3002base64\u9650\u5b9a\u3067\u3059\u3051\u3069\u306d\uff3e\uff3e\uff1b<\/p>\n

\r\nfunction encodeBase64MimeHeader($str,$charset='UTF-8'){\r\n\treturn '=?'.$charset.'?B?'.base64_encode($str).'?='\r\n}\r\n<\/pre>\n

\u6700\u8fd1\u3001\u30e1\u30fc\u30eb\u306b\u95a2\u3059\u308b\u60c5\u5831\u3092\u8abf\u3079\u3066\u3044\u305f\u306e\u3067\u7406\u89e3\u3057\u306a\u304c\u3089\u4fee\u6b63\u3067\u304d\u305f\u611f\u304c\u3042\u308a\u3001\u4e45\u3005\u306bPHP\u3092\u66f8\u3044\u3066\u3066\u5b09\u3057\u304f\u306a\u308a\u307e\u3057\u305fw<\/p>\n","protected":false},"excerpt":{"rendered":"

\u4eca\u65e5\u306f\u4e45\u3005\u306b\u306f\u307e\u3063\u3066\u3057\u307e\u3044\u307e\u3057\u305f\u3002 PHP\u3067UTF8\u306e\u30e1\u30fc\u30eb\u9001\u4fe1\u51e6\u7406\u3092\u4f5c\u6210\u3057\u3066\u3044\u305f\u3093\u3067\u3059\u304c\u3001\u7279\u5b9a\u306e\u6587\u5b57\u5217\u304c\u3042\u308b\u5834\u5408\u306e\u307f\u3001\u4ef6\u540d\u304c\u6587\u5b57\u5316\u3051\u308b\u3093\u3067\u3059\u3088\u3002\u3057\u304b\u3082\u3001\u30ed\u30fc\u30ab\u30eb\u306eUbuntu\u306e\u74b0\u5883\u3067\u306f\u8d77\u304d\u305a\u3001\u30c6\u30b9\u30c8 … \u7d9a\u304d\u3092\u8aad\u3080<\/a><\/p>\n","protected":false},"author":2,"featured_media":9223372036854775807,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":[],"categories":[1980],"tags":[356,357,355],"_links":{"self":[{"href":"https:\/\/blog.fukata.org\/wp-json\/wp\/v2\/posts\/1442"}],"collection":[{"href":"https:\/\/blog.fukata.org\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/blog.fukata.org\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/blog.fukata.org\/wp-json\/wp\/v2\/users\/2"}],"replies":[{"embeddable":true,"href":"https:\/\/blog.fukata.org\/wp-json\/wp\/v2\/comments?post=1442"}],"version-history":[{"count":0,"href":"https:\/\/blog.fukata.org\/wp-json\/wp\/v2\/posts\/1442\/revisions"}],"wp:featuredmedia":[{"embeddable":true,"href":"https:\/\/blog.fukata.org\/wp-json\/wp\/v2\/media\/9223372036854775807"}],"wp:attachment":[{"href":"https:\/\/blog.fukata.org\/wp-json\/wp\/v2\/media?parent=1442"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/blog.fukata.org\/wp-json\/wp\/v2\/categories?post=1442"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/blog.fukata.org\/wp-json\/wp\/v2\/tags?post=1442"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}