{"id":1836,"date":"2019-09-20T16:44:43","date_gmt":"2019-09-20T14:44:43","guid":{"rendered":"https:\/\/myoceane.fr\/?p=1836"},"modified":"2020-05-09T13:12:36","modified_gmt":"2020-05-09T11:12:36","slug":"php-%e5%a6%82%e4%bd%95%e9%87%9d%e5%b0%8d-mysql-%e7%9a%84-utf16-%e9%80%b2%e8%a1%8c%e8%ae%80%e5%af%ab","status":"publish","type":"post","link":"https:\/\/myoceane.fr\/index.php\/php-%e5%a6%82%e4%bd%95%e9%87%9d%e5%b0%8d-mysql-%e7%9a%84-utf16-%e9%80%b2%e8%a1%8c%e8%ae%80%e5%af%ab\/","title":{"rendered":"[PHP] \u5982\u4f55\u5c0d MySQL \u7684 UTF16 \u9032\u884c\u8b80\u5beb"},"content":{"rendered":"<div id=\"fb-root\"><\/div>\n\n<p style=\"text-align: justify;\">\u6ab8\u6aac\u7238\u5728\u958b\u767c PHP \u7db2\u7ad9\u7684\u6642\u5019\u6709\u904b\u7528\u5230 MySQL \u8cc7\u6599\u5eab\uff0c\u7531\u65bc\u7279\u6b8a\u7684\u61c9\u7528\u9700\u6c42\uff0c\u5728\u67d0\u4e9b\u8868\u683c\u7684\u7d50\u69cb\u4e2d\u9700\u8981\u7528\u5230 utf16_unicode_ci \u7684\u7de8\u78bc\u3002\u4f46\u5728\u5229\u7528\u67d0\u4e9b PHP framework \u4f8b\u5982 (CodeIgnitor) \u5c0d\u8cc7\u6599\u5eab\u9032\u884c\u8b80\u5beb\u7684\u6642\u5019\u7531\u65bc character-set \u9810\u8a2d\u70ba utf8 \u6240\u4ee5\u6703\u51fa\u73fe\u4e82\u78bc\u7684\u60c5\u6cc1\uff0c\u672c\u7bc7\u60f3\u8981\u4ecb\u7d39\u9047\u5230\u6b64\u4f9d\u60c5\u6cc1\u6642\u53ef\u80fd\u7684\u89e3\u6c7a\u65b9\u6cd5\u3002<\/p>\n\n\n\n<p>\u5047\u8a2d\u4ee5\u4e0b\u662f\u6211\u5011\u7684\u76ee\u6a19\u8868\u683c\u7d50\u69cb\uff1a<\/p>\n\n\n\n<figure class=\"wp-block-image\"><img loading=\"lazy\" decoding=\"async\" width=\"1024\" height=\"107\" src=\"https:\/\/myoceane.fr\/wp-content\/uploads\/2019\/09\/\u87a2\u5e55\u5feb\u7167-2019-09-19-\u4e0b\u53485.47.21-1024x107.png\" alt=\"\" class=\"wp-image-1842\" srcset=\"https:\/\/myoceane.fr\/wp-content\/uploads\/2019\/09\/\u87a2\u5e55\u5feb\u7167-2019-09-19-\u4e0b\u53485.47.21-1024x107.png 1024w, https:\/\/myoceane.fr\/wp-content\/uploads\/2019\/09\/\u87a2\u5e55\u5feb\u7167-2019-09-19-\u4e0b\u53485.47.21-300x31.png 300w, https:\/\/myoceane.fr\/wp-content\/uploads\/2019\/09\/\u87a2\u5e55\u5feb\u7167-2019-09-19-\u4e0b\u53485.47.21-768x81.png 768w, https:\/\/myoceane.fr\/wp-content\/uploads\/2019\/09\/\u87a2\u5e55\u5feb\u7167-2019-09-19-\u4e0b\u53485.47.21.png 1984w\" sizes=\"auto, (max-width: 1024px) 100vw, 1024px\" \/><\/figure>\n\n\n\n<p style=\"text-align: justify;\">\u5176\u4e2d test \u6b04\u4f4d\u7684\u7de8\u78bc\u662f\u4f7f\u7528 utf16_unicode_ci \u539f\u56e0\u662f\u56e0\u70ba\u6709\u4e00\u4e9b\u7279\u6b8a\u5b57\u5143\uff0c\u4f8b\u5982\u4ee5\u4e0b\u6211\u5011\u5217\u51fa\u7684\u7bc4\u4f8b\uff0c\u5176\u4e2d test \u6b04\u4f4d\u4e2d\u7684\u5167\u5bb9\uff0c\u4e26\u4e0d\u88ab utf8 \u6240\u652f\u63f4\uff0c\u5982\u679c\u6b04\u4f4d\u9078\u64c7 utf8_unicode_ci \u5247\u6703\u51fa\u73fe\uff1f\u7684\u4e82\u78bc\uff01<\/p>\n\n\n\n<div class=\"wp-block-image\"><figure class=\"aligncenter\"><img loading=\"lazy\" decoding=\"async\" width=\"300\" height=\"121\" src=\"https:\/\/myoceane.fr\/wp-content\/uploads\/2019\/09\/\u87a2\u5e55\u5feb\u7167-2019-09-19-\u4e0b\u53485.52.20-300x121.png\" alt=\"\" class=\"wp-image-1843\" srcset=\"https:\/\/myoceane.fr\/wp-content\/uploads\/2019\/09\/\u87a2\u5e55\u5feb\u7167-2019-09-19-\u4e0b\u53485.52.20-300x121.png 300w, https:\/\/myoceane.fr\/wp-content\/uploads\/2019\/09\/\u87a2\u5e55\u5feb\u7167-2019-09-19-\u4e0b\u53485.52.20.png 618w\" sizes=\"auto, (max-width: 300px) 100vw, 300px\" \/><\/figure><\/div>\n\n\n\n<h5>\u89e3\u6c7a\u65b9\u6cd5\uff1a<\/h5>\n<p>\u89e3\u6c7a\u65b9\u6cd5\u7684\u60f3\u6cd5\u662f\u5728\u8b80\u5beb\u7684\u6642\u5019\uff0c\u9806\u4fbf\u8f49\u63db\u8cc7\u6599\u578b\u614b\u5230\u4e8c\u9032\u4f4d\u6216\u662f\u5341\u516d\u9032\u4f4d\uff0c\u4ee5\u4e0b\u6211\u5011\u5217\u51fa\u5728\u8b80\u5beb\u6642\u5019\u6703\u9700\u8981\u7528\u7684 SQL \u6307\u4ee4\uff1a<\/p>\n<pre class=\"lang:sql\">SELECT CONVERT(`test` USING Binary) from `t1` WHERE a = 1;\n\nINSERT INTO `t1`(`a`, `b`, `test`) VALUES (9, 2, CONVERT(0xd841df79 USING utf16))<\/pre>\n\n\n\n<p><strong>\u5229\u7528 PHP (CodeIgnitor) \u5c07 utf-16 \u7684\u8cc7\u6599\u5f9e MySQL \u8b80\u51fa\uff1a<\/strong><\/p>\n<pre class=\"lang:php\">$mysqli = $this-&gt;get_mysqli();\n$result = $mysqli-&gt;query('SELECT CONVERT(test USING binary) as temp FROM `t1` WHERE a = 1 FOR UPDATE;');\n$row = mysqli_fetch_assoc($result);\necho mb_convert_encoding($row[\"temp\"], 'UTF-8', 'UTF-16');<\/pre>\n\n\n\n<p><strong>\u5229\u7528 PHP (CodeIgnitor) \u5c07 utf-16 \u7684\u8cc7\u6599\u5beb\u5165 MySQL \u88e1\u9762\uff1a<\/strong><\/p>\n<p>\u9996\u5148\u6211\u5011\u9700\u8981\u5c07\u5df2\u77e5\u7684\u5b57\u4e32\u8f49\u63db\u6210 Binary \u7684\u5f62\u5f0f\uff0c\u4f8b\u5982 &#8220;0xd841df79&#8243;\uff0c\u5099\u8a3b\uff1a\u9019\u908a\u7531\u65bc\u6211\u5011\u7684\u7db2\u7ad9\u4e5f\u4e0d\u652f\u63f4 utf-16 \u7de8\u78bc\uff0c\u6240\u4ee5\u4ee5\u4e0b\u7684\u7a0b\u5f0f\u78bc\u5247\u662f\u4f7f\u7528&#8221;\u754c\u5202\u8eca\u7acb&#8221;\u4ee3\u66ff\u6211\u5011\u8981\u7684\u8f38\u5165\uff1a<\/p>\n<pre class=\"lang:php\">$input = \"\u754c\u5202\u8eca\u7acb\"; echo mb_strtoupper(bin2hex(mb_convert_encoding($input, 'UTF-16BE', 'UTF-8')));<\/pre>\n<p>\u5f97\u5230\u8f38\u51fa\u7d50\u679c\uff1a<\/p>\n<pre class=\"lang:bash\">D841DF79D860DEE2<\/pre>\n<p>\u5229\u7528\u7522\u751f\u51fa\u4f86 UTF-16 \u7684\u5341\u516d\u4f4d\u5143\u78bc\uff0c\u6211\u5011\u5229\u7528\u4ee5\u4e0b\u7684\u7a0b\u5f0f\u78bc\u8f38\u5165\u8868\u683c\u4e2d\uff1a&nbsp;<\/p>\n<pre class=\"lang:php\">$word = \"0xD841DF79D860DEE2\";\n$mysqli = $this-&gt;get_mysqli(); \n$query = sprintf('INSERT INTO `t1` (`a`,`b`,`test`) VALUES (11, 8, CONVERT(%s USING utf16))', $word); \n$result = $mysqli-&gt;query($query); \n$mysqli-&gt;commit();<\/pre>\n\n\n\n<p>\u6700\u5f8c\u6211\u5011\u7684 t1 \u8868\u683c\u6703\u5448\u73fe\u4ee5\u4e0b\u7684\u6a23\u8c8c\uff1a<\/p>\n\n\n\n<div class=\"wp-block-image\"><figure class=\"aligncenter\"><img loading=\"lazy\" decoding=\"async\" width=\"300\" height=\"147\" src=\"https:\/\/myoceane.fr\/wp-content\/uploads\/2019\/09\/\u87a2\u5e55\u5feb\u7167-2019-09-20-\u4e0b\u53484.49.01-300x147.png\" alt=\"\" class=\"wp-image-1872\" srcset=\"https:\/\/myoceane.fr\/wp-content\/uploads\/2019\/09\/\u87a2\u5e55\u5feb\u7167-2019-09-20-\u4e0b\u53484.49.01-300x147.png 300w, https:\/\/myoceane.fr\/wp-content\/uploads\/2019\/09\/\u87a2\u5e55\u5feb\u7167-2019-09-20-\u4e0b\u53484.49.01.png 628w\" sizes=\"auto, (max-width: 300px) 100vw, 300px\" \/><\/figure><\/div>\n","protected":false},"excerpt":{"rendered":"<p>\u6ab8\u6aac\u7238\u5728\u958b\u767c PHP \u7db2\u7ad9\u7684\u6642\u5019\u6709\u904b\u7528\u5230 MySQL \u8cc7\u6599\u5eab\uff0c\u7531\u65bc\u7279\u6b8a\u7684\u61c9\u7528\u9700\u6c42\uff0c\u5728\u67d0\u4e9b\u8868\u683c\u7684\u7d50\u69cb\u4e2d\u9700\u8981\u7528\u5230 utf16_unicode_ci \u7684\u7de8\u78bc\u3002\u4f46\u5728\u5229\u7528\u67d0\u4e9b PHP framework \u4f8b\u5982 (CodeIgnitor) \u5c0d\u8cc7\u6599\u5eab\u9032\u884c\u8b80\u5beb\u7684\u6642\u5019\u7531\u65bc character-set \u9810\u8a2d\u70ba utf8 \u6240\u4ee5\u6703\u51fa\u73fe\u4e82\u78bc\u7684\u60c5\u6cc1\uff0c\u672c\u7bc7\u60f3\u8981\u4ecb\u7d39\u9047\u5230\u6b64\u4f9d\u60c5\u6cc1\u6642\u53ef\u80fd\u7684\u89e3\u6c7a\u65b9\u6cd5\u3002<\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[8],"tags":[33,34,32],"class_list":["post-1836","post","type-post","status-publish","format-standard","hentry","category-website","tag-mysql","tag-php","tag-utf-16"],"yoast_head":"<!-- This site is optimized with the Yoast SEO plugin v24.6 - https:\/\/yoast.com\/wordpress\/plugins\/seo\/ -->\n<title>[PHP] \u5982\u4f55\u5c0d MySQL \u7684 UTF16 \u9032\u884c\u8b80\u5beb - \u60f3\u65b9\u6d89\u6cd5 - \u91cf\u74f6\u5916\u7684\u5929\u7a7a M-Y-Oceane<\/title>\n<meta name=\"description\" content=\"\u6ab8\u6aac\u7238\u5728\u958b\u767c PHP \u7db2\u7ad9\u7684\u6642\u5019\u6709\u904b\u7528\u5230 MySQL \u8cc7\u6599\u5eab\uff0c\u7531\u65bc\u7279\u6b8a\u7684\u61c9\u7528\u9700\u6c42\uff0c\u5728\u67d0\u4e9b\u8868\u683c\u7684\u7d50\u69cb\u4e2d\u9700\u8981\u7528\u5230 utf16_unicode_ci \u7684\u7de8\u78bc\u3002\u4f46\u5728\u5229\u7528\u67d0\u4e9b PHP framework \u4f8b\u5982 (CodeIgnitor) \u5c0d\u8cc7\u6599\u5eab\u9032\u884c\u8b80\u5beb\u7684\u6642\u5019\u7531\u65bc character-set \u9810\u8a2d\u70ba utf8 \u6240\u4ee5\u6703\u51fa\u73fe\u4e82\u78bc\u7684\u60c5\u6cc1\uff0c\u672c\u7bc7\u60f3\u8981\u4ecb\u7d39\u9047\u5230\u6b64\u4f9d\u60c5\u6cc1\u6642\u53ef\u80fd\u7684\u89e3\u6c7a\u65b9\u6cd5\u3002\" \/>\n<meta name=\"robots\" content=\"index, follow, max-snippet:-1, max-image-preview:large, max-video-preview:-1\" \/>\n<link rel=\"canonical\" href=\"https:\/\/myoceane.fr\/index.php\/php-\u5982\u4f55\u91dd\u5c0d-mysql-\u7684-utf16-\u9032\u884c\u8b80\u5beb\/\" \/>\n<meta property=\"og:locale\" content=\"en_US\" \/>\n<meta property=\"og:type\" content=\"article\" \/>\n<meta property=\"og:title\" content=\"[PHP] \u5982\u4f55\u5c0d MySQL \u7684 UTF16 \u9032\u884c\u8b80\u5beb - \u60f3\u65b9\u6d89\u6cd5 - \u91cf\u74f6\u5916\u7684\u5929\u7a7a M-Y-Oceane\" \/>\n<meta property=\"og:description\" content=\"\u6ab8\u6aac\u7238\u5728\u958b\u767c PHP \u7db2\u7ad9\u7684\u6642\u5019\u6709\u904b\u7528\u5230 MySQL \u8cc7\u6599\u5eab\uff0c\u7531\u65bc\u7279\u6b8a\u7684\u61c9\u7528\u9700\u6c42\uff0c\u5728\u67d0\u4e9b\u8868\u683c\u7684\u7d50\u69cb\u4e2d\u9700\u8981\u7528\u5230 utf16_unicode_ci \u7684\u7de8\u78bc\u3002\u4f46\u5728\u5229\u7528\u67d0\u4e9b PHP framework \u4f8b\u5982 (CodeIgnitor) \u5c0d\u8cc7\u6599\u5eab\u9032\u884c\u8b80\u5beb\u7684\u6642\u5019\u7531\u65bc character-set \u9810\u8a2d\u70ba utf8 \u6240\u4ee5\u6703\u51fa\u73fe\u4e82\u78bc\u7684\u60c5\u6cc1\uff0c\u672c\u7bc7\u60f3\u8981\u4ecb\u7d39\u9047\u5230\u6b64\u4f9d\u60c5\u6cc1\u6642\u53ef\u80fd\u7684\u89e3\u6c7a\u65b9\u6cd5\u3002\" \/>\n<meta property=\"og:url\" content=\"https:\/\/myoceane.fr\/index.php\/php-\u5982\u4f55\u91dd\u5c0d-mysql-\u7684-utf16-\u9032\u884c\u8b80\u5beb\/\" \/>\n<meta property=\"og:site_name\" content=\"\u60f3\u65b9\u6d89\u6cd5 - \u91cf\u74f6\u5916\u7684\u5929\u7a7a M-Y-Oceane\" \/>\n<meta property=\"article:published_time\" content=\"2019-09-20T14:44:43+00:00\" \/>\n<meta property=\"article:modified_time\" content=\"2020-05-09T11:12:36+00:00\" \/>\n<meta name=\"author\" content=\"\u6ab8\u6aac\u7238\" \/>\n<meta name=\"twitter:card\" content=\"summary_large_image\" \/>\n<meta name=\"twitter:label1\" content=\"Written by\" \/>\n\t<meta name=\"twitter:data1\" content=\"\u6ab8\u6aac\u7238\" \/>\n\t<meta name=\"twitter:label2\" content=\"Est. reading time\" \/>\n\t<meta name=\"twitter:data2\" content=\"1 minute\" \/>\n<script type=\"application\/ld+json\" class=\"yoast-schema-graph\">{\"@context\":\"https:\/\/schema.org\",\"@graph\":[{\"@type\":\"Article\",\"@id\":\"https:\/\/myoceane.fr\/index.php\/php-%e5%a6%82%e4%bd%95%e9%87%9d%e5%b0%8d-mysql-%e7%9a%84-utf16-%e9%80%b2%e8%a1%8c%e8%ae%80%e5%af%ab\/#article\",\"isPartOf\":{\"@id\":\"https:\/\/myoceane.fr\/index.php\/php-%e5%a6%82%e4%bd%95%e9%87%9d%e5%b0%8d-mysql-%e7%9a%84-utf16-%e9%80%b2%e8%a1%8c%e8%ae%80%e5%af%ab\/\"},\"author\":{\"name\":\"\u6ab8\u6aac\u7238\",\"@id\":\"https:\/\/myoceane.fr\/#\/schema\/person\/4a4552fb8c27693083d465e12db7658b\"},\"headline\":\"[PHP] \u5982\u4f55\u5c0d MySQL \u7684 UTF16 \u9032\u884c\u8b80\u5beb\",\"datePublished\":\"2019-09-20T14:44:43+00:00\",\"dateModified\":\"2020-05-09T11:12:36+00:00\",\"mainEntityOfPage\":{\"@id\":\"https:\/\/myoceane.fr\/index.php\/php-%e5%a6%82%e4%bd%95%e9%87%9d%e5%b0%8d-mysql-%e7%9a%84-utf16-%e9%80%b2%e8%a1%8c%e8%ae%80%e5%af%ab\/\"},\"wordCount\":38,\"commentCount\":1,\"publisher\":{\"@id\":\"https:\/\/myoceane.fr\/#\/schema\/person\/4a4552fb8c27693083d465e12db7658b\"},\"keywords\":[\"MySQL\",\"PHP\",\"UTF-16\"],\"articleSection\":[\"Website\"],\"inLanguage\":\"en-US\",\"potentialAction\":[{\"@type\":\"CommentAction\",\"name\":\"Comment\",\"target\":[\"https:\/\/myoceane.fr\/index.php\/php-%e5%a6%82%e4%bd%95%e9%87%9d%e5%b0%8d-mysql-%e7%9a%84-utf16-%e9%80%b2%e8%a1%8c%e8%ae%80%e5%af%ab\/#respond\"]}]},{\"@type\":\"WebPage\",\"@id\":\"https:\/\/myoceane.fr\/index.php\/php-%e5%a6%82%e4%bd%95%e9%87%9d%e5%b0%8d-mysql-%e7%9a%84-utf16-%e9%80%b2%e8%a1%8c%e8%ae%80%e5%af%ab\/\",\"url\":\"https:\/\/myoceane.fr\/index.php\/php-%e5%a6%82%e4%bd%95%e9%87%9d%e5%b0%8d-mysql-%e7%9a%84-utf16-%e9%80%b2%e8%a1%8c%e8%ae%80%e5%af%ab\/\",\"name\":\"[PHP] \u5982\u4f55\u5c0d MySQL \u7684 UTF16 \u9032\u884c\u8b80\u5beb - \u60f3\u65b9\u6d89\u6cd5 - \u91cf\u74f6\u5916\u7684\u5929\u7a7a M-Y-Oceane\",\"isPartOf\":{\"@id\":\"https:\/\/myoceane.fr\/#website\"},\"datePublished\":\"2019-09-20T14:44:43+00:00\",\"dateModified\":\"2020-05-09T11:12:36+00:00\",\"description\":\"\u6ab8\u6aac\u7238\u5728\u958b\u767c PHP \u7db2\u7ad9\u7684\u6642\u5019\u6709\u904b\u7528\u5230 MySQL \u8cc7\u6599\u5eab\uff0c\u7531\u65bc\u7279\u6b8a\u7684\u61c9\u7528\u9700\u6c42\uff0c\u5728\u67d0\u4e9b\u8868\u683c\u7684\u7d50\u69cb\u4e2d\u9700\u8981\u7528\u5230 utf16_unicode_ci \u7684\u7de8\u78bc\u3002\u4f46\u5728\u5229\u7528\u67d0\u4e9b PHP framework \u4f8b\u5982 (CodeIgnitor) \u5c0d\u8cc7\u6599\u5eab\u9032\u884c\u8b80\u5beb\u7684\u6642\u5019\u7531\u65bc character-set \u9810\u8a2d\u70ba utf8 \u6240\u4ee5\u6703\u51fa\u73fe\u4e82\u78bc\u7684\u60c5\u6cc1\uff0c\u672c\u7bc7\u60f3\u8981\u4ecb\u7d39\u9047\u5230\u6b64\u4f9d\u60c5\u6cc1\u6642\u53ef\u80fd\u7684\u89e3\u6c7a\u65b9\u6cd5\u3002\",\"breadcrumb\":{\"@id\":\"https:\/\/myoceane.fr\/index.php\/php-%e5%a6%82%e4%bd%95%e9%87%9d%e5%b0%8d-mysql-%e7%9a%84-utf16-%e9%80%b2%e8%a1%8c%e8%ae%80%e5%af%ab\/#breadcrumb\"},\"inLanguage\":\"en-US\",\"potentialAction\":[{\"@type\":\"ReadAction\",\"target\":[\"https:\/\/myoceane.fr\/index.php\/php-%e5%a6%82%e4%bd%95%e9%87%9d%e5%b0%8d-mysql-%e7%9a%84-utf16-%e9%80%b2%e8%a1%8c%e8%ae%80%e5%af%ab\/\"]}]},{\"@type\":\"BreadcrumbList\",\"@id\":\"https:\/\/myoceane.fr\/index.php\/php-%e5%a6%82%e4%bd%95%e9%87%9d%e5%b0%8d-mysql-%e7%9a%84-utf16-%e9%80%b2%e8%a1%8c%e8%ae%80%e5%af%ab\/#breadcrumb\",\"itemListElement\":[{\"@type\":\"ListItem\",\"position\":1,\"name\":\"Home\",\"item\":\"https:\/\/myoceane.fr\/\"},{\"@type\":\"ListItem\",\"position\":2,\"name\":\"[PHP] \u5982\u4f55\u5c0d MySQL \u7684 UTF16 \u9032\u884c\u8b80\u5beb\"}]},{\"@type\":\"WebSite\",\"@id\":\"https:\/\/myoceane.fr\/#website\",\"url\":\"https:\/\/myoceane.fr\/\",\"name\":\"M-Y-Oceane \u60f3\u65b9\u6d89\u6cd5\u3002\u91cf\u74f6\u5916\u7684\u5929\u7a7a\",\"description\":\"\u60f3\u65b9\u6d89\u6cd5, France, Taiwan, Health, Information Technology\",\"publisher\":{\"@id\":\"https:\/\/myoceane.fr\/#\/schema\/person\/4a4552fb8c27693083d465e12db7658b\"},\"potentialAction\":[{\"@type\":\"SearchAction\",\"target\":{\"@type\":\"EntryPoint\",\"urlTemplate\":\"https:\/\/myoceane.fr\/?s={search_term_string}\"},\"query-input\":{\"@type\":\"PropertyValueSpecification\",\"valueRequired\":true,\"valueName\":\"search_term_string\"}}],\"inLanguage\":\"en-US\"},{\"@type\":[\"Person\",\"Organization\"],\"@id\":\"https:\/\/myoceane.fr\/#\/schema\/person\/4a4552fb8c27693083d465e12db7658b\",\"name\":\"\u6ab8\u6aac\u7238\",\"image\":{\"@type\":\"ImageObject\",\"inLanguage\":\"en-US\",\"@id\":\"https:\/\/myoceane.fr\/#\/schema\/person\/image\/\",\"url\":\"https:\/\/secure.gravatar.com\/avatar\/6cc678684664f8ad45a8d56a6630b183?s=96&d=mm&r=g\",\"contentUrl\":\"https:\/\/secure.gravatar.com\/avatar\/6cc678684664f8ad45a8d56a6630b183?s=96&d=mm&r=g\",\"caption\":\"\u6ab8\u6aac\u7238\"},\"logo\":{\"@id\":\"https:\/\/myoceane.fr\/#\/schema\/person\/image\/\"},\"url\":\"https:\/\/myoceane.fr\/index.php\/author\/johnny5584767gmail-com\/\"}]}<\/script>\n<!-- \/ Yoast SEO plugin. -->","yoast_head_json":{"title":"[PHP] \u5982\u4f55\u5c0d MySQL \u7684 UTF16 \u9032\u884c\u8b80\u5beb - \u60f3\u65b9\u6d89\u6cd5 - \u91cf\u74f6\u5916\u7684\u5929\u7a7a M-Y-Oceane","description":"\u6ab8\u6aac\u7238\u5728\u958b\u767c PHP \u7db2\u7ad9\u7684\u6642\u5019\u6709\u904b\u7528\u5230 MySQL \u8cc7\u6599\u5eab\uff0c\u7531\u65bc\u7279\u6b8a\u7684\u61c9\u7528\u9700\u6c42\uff0c\u5728\u67d0\u4e9b\u8868\u683c\u7684\u7d50\u69cb\u4e2d\u9700\u8981\u7528\u5230 utf16_unicode_ci \u7684\u7de8\u78bc\u3002\u4f46\u5728\u5229\u7528\u67d0\u4e9b PHP framework \u4f8b\u5982 (CodeIgnitor) \u5c0d\u8cc7\u6599\u5eab\u9032\u884c\u8b80\u5beb\u7684\u6642\u5019\u7531\u65bc character-set \u9810\u8a2d\u70ba utf8 \u6240\u4ee5\u6703\u51fa\u73fe\u4e82\u78bc\u7684\u60c5\u6cc1\uff0c\u672c\u7bc7\u60f3\u8981\u4ecb\u7d39\u9047\u5230\u6b64\u4f9d\u60c5\u6cc1\u6642\u53ef\u80fd\u7684\u89e3\u6c7a\u65b9\u6cd5\u3002","robots":{"index":"index","follow":"follow","max-snippet":"max-snippet:-1","max-image-preview":"max-image-preview:large","max-video-preview":"max-video-preview:-1"},"canonical":"https:\/\/myoceane.fr\/index.php\/php-\u5982\u4f55\u91dd\u5c0d-mysql-\u7684-utf16-\u9032\u884c\u8b80\u5beb\/","og_locale":"en_US","og_type":"article","og_title":"[PHP] \u5982\u4f55\u5c0d MySQL \u7684 UTF16 \u9032\u884c\u8b80\u5beb - \u60f3\u65b9\u6d89\u6cd5 - \u91cf\u74f6\u5916\u7684\u5929\u7a7a M-Y-Oceane","og_description":"\u6ab8\u6aac\u7238\u5728\u958b\u767c PHP \u7db2\u7ad9\u7684\u6642\u5019\u6709\u904b\u7528\u5230 MySQL \u8cc7\u6599\u5eab\uff0c\u7531\u65bc\u7279\u6b8a\u7684\u61c9\u7528\u9700\u6c42\uff0c\u5728\u67d0\u4e9b\u8868\u683c\u7684\u7d50\u69cb\u4e2d\u9700\u8981\u7528\u5230 utf16_unicode_ci \u7684\u7de8\u78bc\u3002\u4f46\u5728\u5229\u7528\u67d0\u4e9b PHP framework \u4f8b\u5982 (CodeIgnitor) \u5c0d\u8cc7\u6599\u5eab\u9032\u884c\u8b80\u5beb\u7684\u6642\u5019\u7531\u65bc character-set \u9810\u8a2d\u70ba utf8 \u6240\u4ee5\u6703\u51fa\u73fe\u4e82\u78bc\u7684\u60c5\u6cc1\uff0c\u672c\u7bc7\u60f3\u8981\u4ecb\u7d39\u9047\u5230\u6b64\u4f9d\u60c5\u6cc1\u6642\u53ef\u80fd\u7684\u89e3\u6c7a\u65b9\u6cd5\u3002","og_url":"https:\/\/myoceane.fr\/index.php\/php-\u5982\u4f55\u91dd\u5c0d-mysql-\u7684-utf16-\u9032\u884c\u8b80\u5beb\/","og_site_name":"\u60f3\u65b9\u6d89\u6cd5 - \u91cf\u74f6\u5916\u7684\u5929\u7a7a M-Y-Oceane","article_published_time":"2019-09-20T14:44:43+00:00","article_modified_time":"2020-05-09T11:12:36+00:00","author":"\u6ab8\u6aac\u7238","twitter_card":"summary_large_image","twitter_misc":{"Written by":"\u6ab8\u6aac\u7238","Est. reading time":"1 minute"},"schema":{"@context":"https:\/\/schema.org","@graph":[{"@type":"Article","@id":"https:\/\/myoceane.fr\/index.php\/php-%e5%a6%82%e4%bd%95%e9%87%9d%e5%b0%8d-mysql-%e7%9a%84-utf16-%e9%80%b2%e8%a1%8c%e8%ae%80%e5%af%ab\/#article","isPartOf":{"@id":"https:\/\/myoceane.fr\/index.php\/php-%e5%a6%82%e4%bd%95%e9%87%9d%e5%b0%8d-mysql-%e7%9a%84-utf16-%e9%80%b2%e8%a1%8c%e8%ae%80%e5%af%ab\/"},"author":{"name":"\u6ab8\u6aac\u7238","@id":"https:\/\/myoceane.fr\/#\/schema\/person\/4a4552fb8c27693083d465e12db7658b"},"headline":"[PHP] \u5982\u4f55\u5c0d MySQL \u7684 UTF16 \u9032\u884c\u8b80\u5beb","datePublished":"2019-09-20T14:44:43+00:00","dateModified":"2020-05-09T11:12:36+00:00","mainEntityOfPage":{"@id":"https:\/\/myoceane.fr\/index.php\/php-%e5%a6%82%e4%bd%95%e9%87%9d%e5%b0%8d-mysql-%e7%9a%84-utf16-%e9%80%b2%e8%a1%8c%e8%ae%80%e5%af%ab\/"},"wordCount":38,"commentCount":1,"publisher":{"@id":"https:\/\/myoceane.fr\/#\/schema\/person\/4a4552fb8c27693083d465e12db7658b"},"keywords":["MySQL","PHP","UTF-16"],"articleSection":["Website"],"inLanguage":"en-US","potentialAction":[{"@type":"CommentAction","name":"Comment","target":["https:\/\/myoceane.fr\/index.php\/php-%e5%a6%82%e4%bd%95%e9%87%9d%e5%b0%8d-mysql-%e7%9a%84-utf16-%e9%80%b2%e8%a1%8c%e8%ae%80%e5%af%ab\/#respond"]}]},{"@type":"WebPage","@id":"https:\/\/myoceane.fr\/index.php\/php-%e5%a6%82%e4%bd%95%e9%87%9d%e5%b0%8d-mysql-%e7%9a%84-utf16-%e9%80%b2%e8%a1%8c%e8%ae%80%e5%af%ab\/","url":"https:\/\/myoceane.fr\/index.php\/php-%e5%a6%82%e4%bd%95%e9%87%9d%e5%b0%8d-mysql-%e7%9a%84-utf16-%e9%80%b2%e8%a1%8c%e8%ae%80%e5%af%ab\/","name":"[PHP] \u5982\u4f55\u5c0d MySQL \u7684 UTF16 \u9032\u884c\u8b80\u5beb - \u60f3\u65b9\u6d89\u6cd5 - \u91cf\u74f6\u5916\u7684\u5929\u7a7a M-Y-Oceane","isPartOf":{"@id":"https:\/\/myoceane.fr\/#website"},"datePublished":"2019-09-20T14:44:43+00:00","dateModified":"2020-05-09T11:12:36+00:00","description":"\u6ab8\u6aac\u7238\u5728\u958b\u767c PHP \u7db2\u7ad9\u7684\u6642\u5019\u6709\u904b\u7528\u5230 MySQL \u8cc7\u6599\u5eab\uff0c\u7531\u65bc\u7279\u6b8a\u7684\u61c9\u7528\u9700\u6c42\uff0c\u5728\u67d0\u4e9b\u8868\u683c\u7684\u7d50\u69cb\u4e2d\u9700\u8981\u7528\u5230 utf16_unicode_ci \u7684\u7de8\u78bc\u3002\u4f46\u5728\u5229\u7528\u67d0\u4e9b PHP framework \u4f8b\u5982 (CodeIgnitor) \u5c0d\u8cc7\u6599\u5eab\u9032\u884c\u8b80\u5beb\u7684\u6642\u5019\u7531\u65bc character-set \u9810\u8a2d\u70ba utf8 \u6240\u4ee5\u6703\u51fa\u73fe\u4e82\u78bc\u7684\u60c5\u6cc1\uff0c\u672c\u7bc7\u60f3\u8981\u4ecb\u7d39\u9047\u5230\u6b64\u4f9d\u60c5\u6cc1\u6642\u53ef\u80fd\u7684\u89e3\u6c7a\u65b9\u6cd5\u3002","breadcrumb":{"@id":"https:\/\/myoceane.fr\/index.php\/php-%e5%a6%82%e4%bd%95%e9%87%9d%e5%b0%8d-mysql-%e7%9a%84-utf16-%e9%80%b2%e8%a1%8c%e8%ae%80%e5%af%ab\/#breadcrumb"},"inLanguage":"en-US","potentialAction":[{"@type":"ReadAction","target":["https:\/\/myoceane.fr\/index.php\/php-%e5%a6%82%e4%bd%95%e9%87%9d%e5%b0%8d-mysql-%e7%9a%84-utf16-%e9%80%b2%e8%a1%8c%e8%ae%80%e5%af%ab\/"]}]},{"@type":"BreadcrumbList","@id":"https:\/\/myoceane.fr\/index.php\/php-%e5%a6%82%e4%bd%95%e9%87%9d%e5%b0%8d-mysql-%e7%9a%84-utf16-%e9%80%b2%e8%a1%8c%e8%ae%80%e5%af%ab\/#breadcrumb","itemListElement":[{"@type":"ListItem","position":1,"name":"Home","item":"https:\/\/myoceane.fr\/"},{"@type":"ListItem","position":2,"name":"[PHP] \u5982\u4f55\u5c0d MySQL \u7684 UTF16 \u9032\u884c\u8b80\u5beb"}]},{"@type":"WebSite","@id":"https:\/\/myoceane.fr\/#website","url":"https:\/\/myoceane.fr\/","name":"M-Y-Oceane \u60f3\u65b9\u6d89\u6cd5\u3002\u91cf\u74f6\u5916\u7684\u5929\u7a7a","description":"\u60f3\u65b9\u6d89\u6cd5, France, Taiwan, Health, Information Technology","publisher":{"@id":"https:\/\/myoceane.fr\/#\/schema\/person\/4a4552fb8c27693083d465e12db7658b"},"potentialAction":[{"@type":"SearchAction","target":{"@type":"EntryPoint","urlTemplate":"https:\/\/myoceane.fr\/?s={search_term_string}"},"query-input":{"@type":"PropertyValueSpecification","valueRequired":true,"valueName":"search_term_string"}}],"inLanguage":"en-US"},{"@type":["Person","Organization"],"@id":"https:\/\/myoceane.fr\/#\/schema\/person\/4a4552fb8c27693083d465e12db7658b","name":"\u6ab8\u6aac\u7238","image":{"@type":"ImageObject","inLanguage":"en-US","@id":"https:\/\/myoceane.fr\/#\/schema\/person\/image\/","url":"https:\/\/secure.gravatar.com\/avatar\/6cc678684664f8ad45a8d56a6630b183?s=96&d=mm&r=g","contentUrl":"https:\/\/secure.gravatar.com\/avatar\/6cc678684664f8ad45a8d56a6630b183?s=96&d=mm&r=g","caption":"\u6ab8\u6aac\u7238"},"logo":{"@id":"https:\/\/myoceane.fr\/#\/schema\/person\/image\/"},"url":"https:\/\/myoceane.fr\/index.php\/author\/johnny5584767gmail-com\/"}]}},"amp_enabled":false,"_links":{"self":[{"href":"https:\/\/myoceane.fr\/index.php\/wp-json\/wp\/v2\/posts\/1836","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/myoceane.fr\/index.php\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/myoceane.fr\/index.php\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/myoceane.fr\/index.php\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/myoceane.fr\/index.php\/wp-json\/wp\/v2\/comments?post=1836"}],"version-history":[{"count":39,"href":"https:\/\/myoceane.fr\/index.php\/wp-json\/wp\/v2\/posts\/1836\/revisions"}],"predecessor-version":[{"id":4308,"href":"https:\/\/myoceane.fr\/index.php\/wp-json\/wp\/v2\/posts\/1836\/revisions\/4308"}],"wp:attachment":[{"href":"https:\/\/myoceane.fr\/index.php\/wp-json\/wp\/v2\/media?parent=1836"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/myoceane.fr\/index.php\/wp-json\/wp\/v2\/categories?post=1836"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/myoceane.fr\/index.php\/wp-json\/wp\/v2\/tags?post=1836"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}