{"id":874,"date":"2018-10-23T23:02:43","date_gmt":"2018-10-23T14:02:43","guid":{"rendered":"http:\/\/qol-kk.com\/wp2\/?p=874"},"modified":"2018-11-14T10:28:22","modified_gmt":"2018-11-14T01:28:22","slug":"post-874","status":"publish","type":"post","link":"https:\/\/qol-kk.com\/wp2\/blog\/2018\/10\/23\/post-874\/","title":{"rendered":"Laravel\u3067\u30cf\u30de\u3063\u305fcharset\uff1autf8mb4"},"content":{"rendered":"<h2>Laravel\u3067\u30cf\u30de\u3063\u305fcharset\uff1autf8mb4<\/h2>\n<p>\u6700\u8fd1Laravel\u3067\u306e\u30d7\u30ed\u30b0\u30e9\u30df\u30f3\u30b0\u306b\u660e\u3051\u66ae\u308c\u3066\u307e\u3059\u3002<br \/>\n\u304a\u304b\u3052\u3067\u30d6\u30ed\u30b0\u306e\u66f4\u65b0\u304c\u758e\u304b\u306b\u306a\u3063\u3066\u307e\u3059\u304c\u3001\u5b8c\u6210\u3057\u305f\u30d7\u30ed\u30b0\u30e9\u30e0\u306f\u304d\u3063\u3068\u7686\u3055\u307e\u306e\u304a\u5f79\u306b\u7acb\u3064\u3082\u306e\u3067\u3042\u308d\u3046\u3068\u601d\u3044\u307e\u3059\u3002<\/p>\n<p>\u305d\u306e\u30d7\u30ed\u30b0\u30e9\u30e0\u306e\u4e2d\u3067\u30cf\u30de\u3063\u305f\u500b\u6240\u306e\u5099\u5fd8\u9332\u3067\u3059\u3002<\/p>\n<h3>\u305d\u3082\u305d\u3082charset\u3063\u3066\u4f55\uff1f<\/h3>\n<p>10\u5e74\u524d\u304f\u3089\u3044\u304b\u3089\u697d\u5929\u5e02\u5834\u3068\u304a\u4ed8\u304d\u5408\u3044\u306e\u3042\u308b\u5e97\u8217\u3055\u3093\u306a\u3089\u304a\u5206\u304b\u308a\u3060\u3068\u601d\u3044\u307e\u3059\u3002<\/p>\n<p>charset\u3068\u306f\u6587\u5b57\u30b3\u30fc\u30c9\u306e\u4e8b\u3067\u3059\u306d\u3002<\/p>\n<p>\u5f0a\u793e\u306e\u51fa\u5e97\u3057\u305f6\u5e74\u524d\u3067\u306f\u3042\u307e\u308a\u8a00\u308f\u308c\u306a\u304f\u306a\u3063\u3066\u3044\u305f\u305d\u3046\u3067\u3059\u304c\u3001\u79c1\u306f\u4f55\u5ea6\u304b\u30b3\u30fc\u30eb\u30bb\u30f3\u30bf\u30fc\u3067\u300echarset\u300f\u3092\u529b\u8aac\u3055\u308c\u307e\u3057\u305f\u3002<br \/>\n\u300c\u30a8\u30af\u30bb\u30eb\u3067\u4f5c\u6210\u3057\u305f\u30c7\u30fc\u30bf\u306f\u300eShift_jis\u300f\u3001\u697d\u5929\u5e02\u5834\u3078\u306eCSV\u66f4\u65b0\u306f\u300eutf8\u300f\u3067\u884c\u3063\u3066\u304f\u3060\u3055\u3044\u3002\u30c7\u30fc\u30bf\u306fAccess\u3067\u4f5c\u6210\u3057\u3066\u304f\u3060\u3055\u3044\u3002Excel\u306f\u30c0\u30e1\u3067\u3059\u3002\u300d<br \/>\n\u4eca\u3067\u3053\u305d\u306a\u304f\u306a\u308a\u307e\u3057\u305f\u304c\u300110\u5e74\u524d\u306e\u697d\u5929\u5e02\u5834\u3067\u306fExcel\u3067\u66f4\u65b0\u3057\u305f\u30c7\u30fc\u30bf\u304c\u4e0a\u624b\u304f\u8868\u793a\u3055\u308c\u306a\u3044\u3068\u3044\u3046\u4e8b\u6848\u304c\u591a\u767a\u3057\u3066\u3044\u305f\u305d\u3046\u3067\u3059\u3002<\/p>\n<p>\u30cd\u30c3\u30c8\u30ef\u30fc\u30af\u4e0a\u306e\u60c5\u5831\u306f\u6700\u7d42\u7684\u306b\u306f0\u30681\u306e\u7f85\u5217\u3067\u3059\u3002<br \/>\n\u3053\u308c\u3089\u306b\u30eb\u30fc\u30eb\u3092\u4f5c\u3063\u3066\u6587\u5b57\u3084\u56f3\u3092\u8868\u3057\u3066\u3044\u308b\u308f\u3051\u3067\u3059\u304c\u3001charset\u3068\u306f\u3053\u306e\u6587\u5b57\u306e\u30eb\u30fc\u30eb\u306e\u4e8b\u3067\u3059\u3002<br \/>\nExcel\u306e\u6a19\u6e96\u306e\u6587\u5b57\u30eb\u30fc\u30eb\u306f\u300eShift_jis\u300f\u3001\u3067\u3082\u697d\u5929\u5e02\u5834\u306e\u66f4\u65b0\u4ed5\u69d8\u306f\u300eutf8\u300f\u3067\u4f5c\u6210\u3057\u3066\u3044\u305f\u304b\u3089\u6587\u5b57\u5316\u3051\u306b\u306a\u3063\u305f\u3068\u3044\u3046\u4e8b\u3067\u3059\u3002<\/p>\n<h2>utf8mb4 \u306f\u7d75\u6587\u5b57\u3082\u53ef\u80fd\u306b\u3057\u305f\u6587\u5b57\u30b3\u30fc\u30c9\u306e\u4e8b<\/h2>\n<p>\u30b9\u30de\u30db\u304c\u6d41\u901a\u3057\u3010\u7d75\u6587\u5b57\u3011\u306e\u6587\u5316\u304c\u5b9a\u7740\u3057\u3066\u304d\u307e\u3057\u305f\u3002<br \/>\n\u305d\u3053\u3067\u3001\u5f93\u6765\u306e\u6587\u5b57\u30b3\u30fc\u30c9\u3067\u306f\u5bfe\u5fdc\u3057\u304d\u308c\u306a\u3044\u3068\u8003\u3048\u65b0\u3057\u3044\u30eb\u30fc\u30eb\u3092\u4f5c\u3063\u305f\u3002\u305d\u308c\u304cutf8mb4\u3067\u3059\u3002<br \/>\n\u305d\u306e\u305f\u3081\u7d75\u6587\u5b57\u3092\u5229\u7528\u3067\u304d\u307e\u3059\u304c\u30011\u6587\u5b57\u5f53\u305f\u308a\u306e\u5bb9\u91cf\u304c\u4eca\u307e\u3067\u306e\u500d\u306e4\u30d0\u30a4\u30c8\u3068\u306a\u308a\u307e\u3057\u305f\u3002<\/p>\n<p>\u30e2\u30fc\u30eb\u3067\u306f\u6587\u5b57\u6570\u5236\u9650\u304c\u3042\u308a\u307e\u3059\u306e\u3067\u3001\u6271\u3048\u308b\u6587\u5b57\u306e\u91cf\u304c\u6e1b\u3063\u305f\u3068\u8a8d\u8b58\u3044\u305f\u3060\u3044\u3066OK\u3067\u3059\u3002<\/p>\n<p>\u30e2\u30fc\u30eb\u51fa\u54c1\u30a2\u30d7\u30ea\u3092\u4f5c\u6210\u3057\u3066\u3044\u308b\u79c1\u304b\u3089\u3059\u308b\u3068\u3053\u306e\u73fe\u8c61\u306f\u5927\u554f\u984c\u3002<br \/>\n\u306a\u305c\u306a\u3089\u4f7f\u3048\u308b\u6587\u5b57\u6570\u304c\u30e2\u30fc\u30eb\u306e\u8981\u4ef6\u3088\u308a\u3082\u5c11\u306a\u304f\u306a\u308b\u53ef\u80fd\u6027\u304c\u3042\u308b\u304b\u3089\u3067\u3059\u3002<br \/>\n\u30b7\u30b9\u30c6\u30e0\u306f\u30e2\u30fc\u30eb\u306e\u4ed5\u69d8\u306b\u5408\u308f\u305b\u306a\u304d\u3083\u4f7f\u3048\u306a\u3044\u3067\u3059\u3088\u306d\u3002<\/p>\n<p>\u3060\u304b\u3089\u5f93\u6765\u306eutf8\u306b\u5909\u66f4\u3057\u305f\u304b\u3063\u305f\u306e\u3067\u3059\u304c\u3001\u3053\u3053\u3067\u5927\u30cf\u30de\u308a\u3057\u305f\u308f\u3051\u3067\u3059\u3002<\/p>\n<h3>Laravel \u306e\u6587\u5b57\u30b3\u30fc\u30c9\u6307\u5b9a\u30f6\u6240\u306f\u8907\u6570\u3042\u308b<\/h3>\n<p>\u30b0\u30b0\u308b\u3068\u51fa\u3066\u304f\u308b\u60c5\u5831\u3067\u6700\u3082\u591a\u3044\u3082\u306e\u306f\u3010my.cnf\u3011\u306e\u66f8\u304d\u63db\u3048\u3067\u3059\u3002<\/p>\n<pre class=\"lang:default decode:true\"># For advice on how to change settings please see\r\n# http:\/\/dev.mysql.com\/doc\/refman\/5.6\/en\/server-configuration-defaults.html\r\n\r\n[mysqld]\r\n#\r\n# Remove leading # and set to the amount of RAM for the most important data\r\n# cache in MySQL. Start at 70% of total RAM for dedicated server, else 10%.\r\n# innodb_buffer_pool_size = 128M\r\n#\r\n# Remove leading # to turn on a very important data integrity option: logging\r\n# changes to the binary log between backups.\r\n# log_bin\r\n#\r\n# Remove leading # to set options mainly useful for reporting servers.\r\n# The server defaults are faster for transactions and fast SELECTs.\r\n# Adjust sizes as needed, experiment to find the optimal values.\r\n# join_buffer_size = 128M\r\n# sort_buffer_size = 2M\r\n# read_rnd_buffer_size = 2M\r\ndatadir=\/var\/lib\/mysql\r\nsocket=\/var\/lib\/mysql\/mysql.sock\r\n\r\ninnodb_large_prefix\r\ninnodb_file_per_table\r\ninnodb_file_format=Barracuda\r\n\r\ncharacter-set-server=utf8\r\ncollation-server=utf8_unicode_ci\r\n\r\n# Disabling symbolic-links is recommended to prevent assorted security risks\r\nsymbolic-links=0\r\n\r\n# Recommended in standard MySQL setup\r\nsql_mode=NO_ENGINE_SUBSTITUTION,STRICT_TRANS_TABLES \r\n\r\nport=13306\r\n\r\n[mysql]\r\ndefault-character-set = utf8\r\n\r\n[client]\r\ndefault-character-set = utf8\r\n\r\n\r\n[mysqld_safe]\r\nlog-error=\/var\/log\/mysqld.log\r\npid-file=\/var\/run\/mysqld\/mysqld.pid\r\n<\/pre>\n<p>\u3053\u306e\u3088\u3046\u306b\u300eutf8mb4\u300f\u3092\u300eutf8\u300f\u306b\u66f8\u304d\u63db\u3048\u3066\u518d\u8d77\u52d5\uff06\u30de\u30a4\u30b0\u30ec\u30fc\u30b7\u30e7\u30f3\u5b9f\u884c\uff01<\/p>\n<p>\u4e0a\u624b\u304f\u3044\u304f\u65b9\u306f\u3053\u308c\u3060\u3051\u3067\u89e3\u6c7a\u3059\u308b\u3088\u3046\u3067\u3059\u304c\u3001\u79c1\u306f\u30c0\u30e1\u3067\u3057\u305f\u3002<\/p>\n<h3>\u00a0config\/database.php \u3092\u78ba\u8a8d<\/h3>\n<p>\u8272\u3005\u30b0\u30b0\u3063\u3066\u30c6\u30b9\u30c8\u3057\u305f\u7d50\u679c\u3001Laravel\u306e config\/database.php \u3092\u5909\u66f4\u3057\u3066\u89e3\u6c7a\u3057\u307e\u3057\u305f\u3002<\/p>\n<pre class=\"lang:default decode:true \">'connections' =&gt; [\r\n\r\n'sqlite' =&gt; [\r\n'driver' =&gt; 'sqlite',\r\n'database' =&gt; env('DB_DATABASE', database_path('database.sqlite')),\r\n'prefix' =&gt; '',\r\n],\r\n\r\n'mysql' =&gt; [\r\n'driver' =&gt; 'mysql',\r\n'host' =&gt; env('DB_HOST', '127.0.0.1'),\r\n'port' =&gt; env('DB_PORT', '3306'),\r\n'database' =&gt; env('DB_DATABASE', 'forge'),\r\n'username' =&gt; env('DB_USERNAME', 'forge'),\r\n'password' =&gt; env('DB_PASSWORD', ''),\r\n'unix_socket' =&gt; env('DB_SOCKET', ''),\r\n'charset' =&gt; 'utf8mb4', \u21d2 'utf8',\u306b\u5909\u66f4\r\n'collation' =&gt; 'utf8mb4_unicode_ci', \u21d2'utf8_general_ci',\u306b\u5909\u66f4\r\n'prefix' =&gt; '',\r\n'strict' =&gt; true,\r\n'engine' =&gt; null,\r\n],\r\n\u3000\u3000],<\/pre>\n<p>\u3053\u3093\u306a\u3068\u3053\u308d\u306b\u3082\u8a2d\u5b9a\u304c\u3042\u3063\u305f\u3093\u3067\u3059\u306d\u3002<\/p>\n<p>\u30de\u30a4\u30b0\u30ec\u30fc\u30b7\u30e7\u30f3\u306e\u7d50\u679c\u3082\u826f\u597d\u3002<\/p>\n<p>\u30c4\u30fc\u30eb\u4f5c\u6210\u9811\u5f35\u308a\u307e\u3059\u3002<\/p>\n<p>&nbsp;<\/p>\n","protected":false},"excerpt":{"rendered":"<p>Laravel\u3067\u30cf\u30de\u3063\u305fcharset\uff1autf8mb4 \u6700\u8fd1Laravel\u3067\u306e\u30d7\u30ed\u30b0\u30e9\u30df\u30f3\u30b0\u306b\u660e\u3051\u66ae\u308c\u3066\u307e\u3059\u3002 \u304a\u304b\u3052\u3067\u30d6\u30ed\u30b0\u306e\u66f4\u65b0\u304c\u758e\u304b\u306b\u306a\u3063\u3066\u307e\u3059\u304c\u3001\u5b8c\u6210\u3057\u305f\u30d7\u30ed\u30b0\u30e9\u30e0\u306f\u304d\u3063\u3068\u7686\u3055\u307e\u306e\u304a\u5f79\u306b\u7acb\u3064\u3082\u306e\u3067\u3042\u308d\u3046\u3068\u601d\u3044\u307e\u3059 [&hellip;]<\/p>\n","protected":false},"author":1,"featured_media":52,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"_jetpack_memberships_contains_paid_content":false,"vkexunit_cta_each_option":"","footnotes":"","jetpack_publicize_message":"","jetpack_publicize_feature_enabled":true,"jetpack_social_post_already_shared":false,"jetpack_social_options":{"image_generator_settings":{"template":"highway","default_image_id":0,"font":"","enabled":false},"version":2}},"categories":[34],"tags":[153,98,155,46,154,49,58],"class_list":["post-874","post","type-post","status-publish","format-standard","has-post-thumbnail","hentry","category-php-memorandum","tag-laravel","tag-php","tag-155","tag-46","tag-154","tag-49","tag-58"],"jetpack_publicize_connections":[],"jetpack_featured_media_url":"https:\/\/qol-kk.com\/wp2\/wp-content\/uploads\/2018\/08\/interface1.jpg","jetpack-related-posts":[],"jetpack_sharing_enabled":true,"_links":{"self":[{"href":"https:\/\/qol-kk.com\/wp2\/wp-json\/wp\/v2\/posts\/874","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/qol-kk.com\/wp2\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/qol-kk.com\/wp2\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/qol-kk.com\/wp2\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/qol-kk.com\/wp2\/wp-json\/wp\/v2\/comments?post=874"}],"version-history":[{"count":0,"href":"https:\/\/qol-kk.com\/wp2\/wp-json\/wp\/v2\/posts\/874\/revisions"}],"wp:featuredmedia":[{"embeddable":true,"href":"https:\/\/qol-kk.com\/wp2\/wp-json\/wp\/v2\/media\/52"}],"wp:attachment":[{"href":"https:\/\/qol-kk.com\/wp2\/wp-json\/wp\/v2\/media?parent=874"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/qol-kk.com\/wp2\/wp-json\/wp\/v2\/categories?post=874"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/qol-kk.com\/wp2\/wp-json\/wp\/v2\/tags?post=874"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}