<?xml version="1.0" encoding="UTF-8"?>
<!-- generator="bbPress/1.0.3" -->
<rss version="2.0"
	xmlns:content="http://purl.org/rss/1.0/modules/content/"
	xmlns:dc="http://purl.org/dc/elements/1.1/"
	xmlns:atom="http://www.w3.org/2005/Atom">
	<channel>
		<title>WassUp Forums &#187; Topic: Missing &#34;DEFAULT CHARSET&#34; in &#34;CREATE TABLE&#34;</title>
		<link>http://www.wpwp.org/forums/topic/missing-default-charset-in-create-table</link>
		<description>WassUp Forums &raquo; Topic: Missing &quot;DEFAULT CHARSET&quot; in &quot;CREATE TABLE&quot;</description>
		<language>en-US</language>
		<pubDate>Sat, 11 Feb 2012 00:40:55 +0000</pubDate>
		<generator>http://bbpress.org/?v=1.0.3</generator>
		<textInput>
			<title><![CDATA[Search]]></title>
			<description><![CDATA[Search all topics from these forums.]]></description>
			<name>q</name>
			<link>http://www.wpwp.org/forums/search.php</link>
		</textInput>
		<atom:link href="http://www.wpwp.org/forums/rss/topic/missing-default-charset-in-create-table" rel="self" type="application/rss+xml" />

		<item>
			<title>Michele on "Missing &#34;DEFAULT CHARSET&#34; in &#34;CREATE TABLE&#34;"</title>
			<link>http://www.wpwp.org/forums/topic/missing-default-charset-in-create-table#post-360</link>
			<pubDate>Fri, 18 Apr 2008 15:03:24 +0000</pubDate>
			<dc:creator>Michele</dc:creator>
			<guid isPermaLink="false">360@http://www.wpwp.org/forums/</guid>
			<description>&#60;p&#62;Thank you very much! I will merge it as soon as possible
&#60;/p&#62;</description>
		</item>
		<item>
			<title>sandajian on "Missing &#34;DEFAULT CHARSET&#34; in &#34;CREATE TABLE&#34;"</title>
			<link>http://www.wpwp.org/forums/topic/missing-default-charset-in-create-table#post-359</link>
			<pubDate>Fri, 18 Apr 2008 14:41:45 +0000</pubDate>
			<dc:creator>sandajian</dc:creator>
			<guid isPermaLink="false">359@http://www.wpwp.org/forums/</guid>
			<description>&#60;p&#62;I installed wassup trunk 129 in my blog &#60;a href=&#34;http://zh.linuxforfun.net/&#34; rel=&#34;nofollow&#34;&#62;http://zh.linuxforfun.net/&#60;/a&#62;, which is in Chinese.  The default charset of the blog is set to 'UTF-8' .  In the wassup page, all Chinese characters in 'KEYWORDS:' are displayed as question marks (?).  I examined the database and found that the table 'wp_zh_linuxforfun_net_wassup' used the charset 'latin1' as its charset, but Wordpress uses 'UTF-8' as the default charset of all tables.&#60;/p&#62;
&#60;p&#62;I edited wassup.php, adding some lines to specify 'DEFAULT CHARSET' of tables in 'CreateTable()'.  After that, Chinese characters in 'KEYWORDS' were displayed correctly.&#60;/p&#62;
&#60;p&#62;The Patch is shown below:&#60;br /&#62;
&#60;pre&#62;&#60;code&#62;--- wassup.php.sav	2008-04-09 08:24:30.000000000 -0700
+++ wassup.php	2008-04-18 06:21:27.000000000 -0700
@@ -1098,6 +1098,13 @@

 function CreateTable($tablename=&#38;quot;wassup&#38;quot;) {
 	global $wpdb;
+	$charset_collate = &#38;#39;&#38;#39;;
+	if ( $wpdb-&#38;gt;supports_collation() ) {
+		if ( ! empty($wpdb-&#38;gt;charset) )
+			$charset_collate = &#38;quot;DEFAULT CHARACTER SET $wpdb-&#38;gt;charset&#38;quot;;
+		if ( ! empty($wpdb-&#38;gt;collate) )
+			$charset_collate .= &#38;quot; COLLATE $wpdb-&#38;gt;collate&#38;quot;;
+	}
 	$table_name = $wpdb-&#38;gt;prefix . $tablename;
 	$sql_createtable = &#38;quot;CREATE TABLE &#38;quot; . $table_name . &#38;quot; (
   id mediumint(9) NOT NULL auto_increment,
@@ -1123,7 +1130,7 @@
   UNIQUE KEY id (id),
   KEY wassup_id (wassup_id),
   INDEX (timestamp)
-);&#38;quot;;
+) $charset_collate;&#38;quot;;
 	require_once( ABSPATH.&#38;#39;wp-admin/upgrade-functions.php&#38;#39;);
 	dbDelta($sql_createtable);
 } //end function createTable&#60;/code&#62;&#60;/pre&#62;</description>
		</item>

	</channel>
</rss>

