{"id":70,"date":"2009-07-11T22:29:05","date_gmt":"2009-07-11T14:29:05","guid":{"rendered":"http:\/\/www.choubb.com\/?p=70"},"modified":"2009-07-12T02:20:26","modified_gmt":"2009-07-11T18:20:26","slug":"%e8%a7%a3%e5%86%b3limesurvey%e7%9a%84%e4%b8%ad%e6%96%87%e4%b9%b1%e7%a0%81%e9%97%ae%e9%a2%98%ef%bc%8c%e8%b7%9fwordpress%e6%9c%89%e7%9b%b8%e4%bc%bc%e4%b9%8b%e5%a4%84","status":"publish","type":"post","link":"https:\/\/www.choubb.com\/?p=70","title":{"rendered":"\u89e3\u51b3Limesurvey\u7684\u4e2d\u6587\u4e71\u7801\u95ee\u9898\uff0c\u8ddfWordPress\u6709\u76f8\u4f3c\u4e4b\u5904"},"content":{"rendered":"<p>\u88c5Wordpresss\u65f6\u4e2d\u6587\u663e\u793a\u201c\uff1f\uff1f\uff1f\u201d\u7684\u95ee\u9898\u5c0f\u5c0f\u56f0\u6270\u4e86\u4ffa\u4e00\u628a\uff0c\u6700\u540e\u7684\u89e3\u51b3\u65b9\u6848\u662f\u628awp-config.php\u7684\u4e0b\u9762\u7684utf8\u5220\u9664\u5c31\u4e00\u5207\u641e\u5b9a\u4e86\u3002\u8fd9\u4e2a\u95ee\u9898\u7684\u539f\u56e0\u662fmqsql\u5b89\u88c5\u7684\u65f6\u5019\uff0ccollation\u7684\u9ed8\u8ba4\u662f<dfn>latin1_swedish_ci<\/dfn>\u3002\u5bf9\u4e8e\u4e2d\u6587\u535a\u5ba2\uff0c\u8fd9\u4e2a\u8bbe\u7f6e\u5e94\u8be5\u662futf8\u3002\u7f51\u4e0a\u627e\u5230\u4ee5\u4e0b\u7684\u65b9\u6cd5\u6210\u529f\u4e86\uff0c\u4f46\u662f\u5fc3\u75c5\u6ca1\u53bb\u554a\uff0c mysql\u91cc\u7684collation\u8fd8\u662f<dfn>latin1_swedish_ci<\/dfn><\/p>\n<p>&#160;<\/p>\n<p>\u6539\u524d\uff1adefine(&#8216;DB_COLLATE&#8217;, &#8216;utf8&#8217;);<\/p>\n<p>\u6539\u540e\uff1adefine(&#8216;DB_COLLATE&#8217;, &#8221;);<\/p>\n<p>&#160;<\/p>\n<p>\u8fd9\u4e0d\u4eca\u5929\u88c5<a href=\"http:\/\/www.limesurvey.org\/\" target=\"_blank\">limesurvey<\/a>\u5c31\u53c8\u51fa\u95ee\u9898\u4e86\uff0c\u627e\u6765\u627e\u53bb\uff0c\u627e\u4e0d\u5230\u7c7b\u4f3c\u4e0a\u9762WP\u7684\u7b80\u5355\u5904\u7406\u65b9\u5f0f\uff0c\u6700\u540e\u7ec8\u4e8e\u5728lime\u7684\u624b\u518c\u91cc\u627e\u5230\u65b9\u6cd5\u4e86\uff0c WP\u4e5f\u53ef\u4ee5\u7528\u7c7b\u4f3c\u7684\u65b9\u6cd5\u5904\u7406\u3002\u6709\u4e24\u79cd\u60c5\u51b5<\/p>\n<p>&#160;<\/p>\n<p>1.<strong>\u88c5\u597d\u4e86Mysql, Limesurvey\/wordpres\u8fd8\u6ca1\u88c5<\/strong>,&#160; \u53ef\u4ee5\u5728phpMyAdmin\u8fd9\u4e48\u6765\u4e00\u4e0b\uff0c \u628a&lt;your_database_name&gt;\u6362\u6210\u4f60\u7684\u6570\u636e\u5e93\u540d<\/p>\n<p><tt>ALTER DATABASE `&lt;your_database_name&gt;` DEFAULT CHARACTER SET utf8 COLLATE utf8_general_ci;<\/tt>     <br \/>Replace &lt;your_database_name&gt; with the name of your database. <strong>You need to do this BEFORE installing LimeSurvey<\/strong>.<\/p>\n<p>2. <strong>Mysql\u548cLimesuurvey\/Wordpress\u4e00\u8d77\u90fd\u88c5\u597d\u4e86<\/strong>\uff0c \u4eba\u5bb6host\u7684script\u4e5f\u662f\u597d\u5fc3\u4e48\uff0c \u54e5\u4eec\u59b9\u4eec\uff0c\u4f60\u8ddf\u6211\u4e00\u6837\u5f97\u9ebb\u70e6\u4e00\u4e9b\u4e86<\/p>\n<p>Go to phpMyAdmin and export your database file so that when you import it later, it overwrites every table that exists. To do that make sure &quot;Add Drop Table&quot; is checked and that &quot;Add if NOT EXISTS&quot; is unchecked. You can leave all other default settings in their current state. <\/p>\n<p>\u8fdb\u5165phpMyAdmin\u5bfc\u51fa\u6570\u636e\u5e93\uff0c\u8bb0\u5f97\u5c06&quot;Add Drop Table&quot;\u52fe\u4e0a\uff0c&quot;Add if NOT EXISTS&quot;\u52fe\u53bb<\/p>\n<p>Make a copy of your exported file so that you have an original backup if anything goes wrong. Rename the duplicate file anything you like, e.g., rev_databasename.sql. <\/p>\n<p>\u5c06\u5bfc\u51fa\u7684\u6570\u636e\u5e93\u5907\u4efd<\/p>\n<p>Open the duplicate text file in any word processing program such as MS Word or WordPad and conduct a find and replace on the words latin1 and utf8, respectively. That is, replace all instances of latin1 with utf8. <\/p>\n<p>\u7528word\u6216wordpad\u4e4b\u7c7b\u7f16\u8f91\u5668\u5c06\u6240\u6709\u7684latin1\u66ff\u6362\u6210utf8<\/p>\n<p>Save and then close the file. Go back to phpMyAdmin and import the modified SQL database file. All preexisting latin1 collated tables should now be replaced with UTF8 collation. If you check the table structure in phpMyAdmin the new collation for each table will now read either &quot;utf8_general_ci&quot; or &quot;utf8_unicode_ci&quot; (depending on the table). This is precisely what you want. <\/p>\n<p>\u6539\u597d\u7684\u6570\u636e\u5e93\u5b58\u76d8\u9000\u51fa\u3002\u56de\u5230phpmyadmin\u91cc\u5bfc\u5165\u6539\u597d\u7684\u6570\u636e\u5e93\u3002\u6240\u6709\u7684collation\u73b0\u5728\u5e94\u8be5\u90fd\u662futf8_general_ci\u4e86\u3002 \u8fd8\u884c\u5427\uff0c \u5c311\u5206\u949f\u7684\u4e8b\u3002<\/p>\n<p>You will need to reenter all your foreign language text and now it will display properly. <\/p>\n<p>\u73b0\u5728\u4f60\u7684\u4e2d\u6587\u5e94\u8be5\u663e\u793a\u6b63\u5e38\u4e86<\/p>\n<p>\u82b1\u7d6e\uff1a \u53d7\u5230\u9f13\u821e\uff0c \u9b54\u6293\u4f38\u5411\u4e86WP.\u610f\u5916\u7684\u662f\u6570\u636e\u5e93\u5012\u51fa\u6765\u6539\u597d\u4e86\uff0c \u5374\u5012\u4e0d\u56de\u53bb\u3002\u4e8e\u662f\u53cd\u590d\u7684\u6539config.php,\u53cd\u590d\u7684\u628a\u4e0d\u540c\u7684\u4e66\u7c4d\u5e93\u5907\u4efd\u5012\u6765\u5012\u53bb\uff0c\u53cd\u590d\u7684<tt>ALTER DATABASE `&lt;your_database_name&gt;` DEFAULT <\/tt>\u3002\u3002\u3002\u6700\u597d\u8fd8\u662f\u4e00\u5207\u56de\u539f\u6837\u4e86\u4e8b\u3002<\/p>\n","protected":false},"excerpt":{"rendered":"<p>\u88c5Wordpresss\u65f6\u4e2d\u6587\u663e\u793a\u201c\uff1f\uff1f\uff1f\u201d\u7684\u95ee\u9898\u5c0f\u5c0f\u56f0\u6270\u4e86\u4ffa\u4e00\u628a\uff0c\u6700\u540e\u7684\u89e3\u51b3\u65b9\u6848\u662f\u628awp-config.php\u7684\u4e0b\u9762\u7684utf8\u5220\u9664\u5c31\u4e00\u5207\u641e\u5b9a\u4e86\u3002\u8fd9\u4e2a\u95ee\u9898\u7684\u539f\u56e0\u662fmqsql\u5b89\u88c5\u7684\u65f6\u5019\uff0ccollation\u7684\u9ed8\u8ba4\u662flatin1_swedish_ci\u3002\u5bf9\u4e8e\u4e2d\u6587\u535a\u5ba2\uff0c\u8fd9\u4e2a\u8bbe\u7f6e\u5e94\u8be5\u662futf8\u3002\u7f51\u4e0a\u627e\u5230\u4ee5\u4e0b\u7684\u65b9\u6cd5\u6210\u529f\u4e86\uff0c\u4f46\u662f\u5fc3\u75c5\u6ca1\u53bb\u554a\uff0c mysql\u91cc\u7684collation\u8fd8\u662flatin1_swedish_ci &#160; \u6539\u524d\uff1adefine(&#8216;DB_COLLATE&#8217;, &#8216;utf8&#8217;); \u6539\u540e\uff1adefine(&#8216;DB_COLLATE&#8217;, &#8221;); &#160; \u8fd9\u4e0d\u4eca\u5929\u88c5limesurvey\u5c31\u53c8\u51fa\u95ee\u9898\u4e86\uff0c\u627e\u6765\u627e\u53bb\uff0c\u627e\u4e0d\u5230\u7c7b\u4f3c\u4e0a\u9762WP\u7684\u7b80\u5355\u5904\u7406\u65b9\u5f0f\uff0c\u6700\u540e\u7ec8\u4e8e\u5728lime\u7684\u624b\u518c\u91cc\u627e\u5230\u65b9\u6cd5\u4e86\uff0c WP\u4e5f\u53ef\u4ee5\u7528\u7c7b\u4f3c\u7684\u65b9\u6cd5\u5904\u7406\u3002\u6709\u4e24\u79cd\u60c5\u51b5 &#160; 1.\u88c5\u597d\u4e86Mysql, Limesurvey\/wordpres\u8fd8\u6ca1\u88c5,&#160; \u53ef\u4ee5\u5728phpMyAdmin\u8fd9\u4e48\u6765\u4e00\u4e0b\uff0c \u628a&lt;your_database_name&gt;\u6362\u6210\u4f60\u7684\u6570\u636e\u5e93\u540d ALTER DATABASE `&lt;your_database_name&gt;` DEFAULT CHARACTER SET utf8 COLLATE utf8_general_ci; Replace &lt;your_database_name&gt; with the name of your database.<a class=\"moretag\" href=\"https:\/\/www.choubb.com\/?p=70\">Read More&#8230;<\/a><\/p>\n","protected":false},"author":2,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[705],"tags":[72,70,67,71,69,66,68],"class_list":["post-70","post","type-post","status-publish","format-standard","hentry","category-705","tag-collation","tag-latin1","tag-limesurvey","tag-mysql","tag-utf8","tag-wordpress","tag-68"],"_links":{"self":[{"href":"https:\/\/www.choubb.com\/index.php?rest_route=\/wp\/v2\/posts\/70","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/www.choubb.com\/index.php?rest_route=\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/www.choubb.com\/index.php?rest_route=\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/www.choubb.com\/index.php?rest_route=\/wp\/v2\/users\/2"}],"replies":[{"embeddable":true,"href":"https:\/\/www.choubb.com\/index.php?rest_route=%2Fwp%2Fv2%2Fcomments&post=70"}],"version-history":[{"count":3,"href":"https:\/\/www.choubb.com\/index.php?rest_route=\/wp\/v2\/posts\/70\/revisions"}],"predecessor-version":[{"id":226,"href":"https:\/\/www.choubb.com\/index.php?rest_route=\/wp\/v2\/posts\/70\/revisions\/226"}],"wp:attachment":[{"href":"https:\/\/www.choubb.com\/index.php?rest_route=%2Fwp%2Fv2%2Fmedia&parent=70"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/www.choubb.com\/index.php?rest_route=%2Fwp%2Fv2%2Fcategories&post=70"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/www.choubb.com\/index.php?rest_route=%2Fwp%2Fv2%2Ftags&post=70"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}