<?xml version="1.0" encoding="UTF-8"?>
<rss version="2.0"
	xmlns:content="http://purl.org/rss/1.0/modules/content/"
	xmlns:wfw="http://wellformedweb.org/CommentAPI/"
	xmlns:dc="http://purl.org/dc/elements/1.1/"
	xmlns:atom="http://www.w3.org/2005/Atom"
	xmlns:sy="http://purl.org/rss/1.0/modules/syndication/"
	xmlns:slash="http://purl.org/rss/1.0/modules/slash/"
	>

<channel>
	<title>abanghazrul.com &#187; Encode Chinese characters</title>
	<atom:link href="http://www.abanghazrul.com/tag/encode-chinese-characters/feed/" rel="self" type="application/rss+xml" />
	<link>http://www.abanghazrul.com</link>
	<description>Finding My Nirvana</description>
	<lastBuildDate>Tue, 10 Jan 2012 13:19:43 +0000</lastBuildDate>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
			<item>
		<title>Getting WordPress to encode non-Roman characters properly</title>
		<link>http://www.abanghazrul.com/notes/getting-wordpress-to-encode-non-roman-characters-properly/</link>
		<comments>http://www.abanghazrul.com/notes/getting-wordpress-to-encode-non-roman-characters-properly/#comments</comments>
		<pubDate>Thu, 24 Jan 2008 19:02:37 +0000</pubDate>
		<dc:creator>Hazrul Azhar Jamari</dc:creator>
				<category><![CDATA[My Notes]]></category>
		<category><![CDATA[Encode Chinese characters]]></category>
		<category><![CDATA[MySQL]]></category>
		<category><![CDATA[WordPress]]></category>

		<guid isPermaLink="false">http://mag.typecanvas.com/2008/01/25/getting-wordpress-to-encode-non-roman-characters-properly/</guid>
		<description><![CDATA[I thought that leaving WordPress&#8217;s database charset to UTF-8 would allow WordPress to display Chinese characters properly. UTF-8 is the file format to [...]]]></description>
			<content:encoded><![CDATA[<div style="padding-top:5px;padding-right:0px;padding-bottom:5px;padding-left:0px;;">
											<iframe
												style="height:25px !important; border:0px solid gray !important; overflow:hidden !important; width:550px !important;" frameborder="0" scrolling="no" allowTransparency="true"
												src="http://www.linksalpha.com/social?blog=abanghazrul.com&link=http%3A%2F%2Fwww.abanghazrul.com%2Fnotes%2Fgetting-wordpress-to-encode-non-roman-characters-properly%2F&title=Getting+Wordpress+to+encode+non-Roman+characters+properly&desc=I+thought+that+leaving+WordPress%27s+database+charset+to+UTF-8+would+allow+WordPress+to+display+Chinese+characters+properly.+UTF-8+is+the+file+format+to+encode+East+Asian+characters+anyway.+Even+during+&fc=333333&fs=trebuchet+ms&fblname=like&fblref=facebook&fbllang=en_US&fblshow=1&fbsbutton=1&fbsctr=1&fbslang=en&fbsendbutton=1&twbutton=1&twlang=en&twmention=&twrelated1=&twrelated2=&twctr=1&lnkdshow=noshow&lnkdctr=1&buzzbutton=1&buzzlang=en&buzzctr=1&diggbutton=1&diggctr=1&stblbutton=1&stblctr=1&g1button=1&g1ctr=1&g1lang=en-US">
											</iframe>
										</div><p>I thought that leaving WordPress&#8217;s database charset to UTF-8 would allow WordPress to display Chinese characters properly. UTF-8 is the file format to encode East Asian characters anyway. Even during MySQL installation, choosing UTF-8 charset would save database contents compatible for East Asian characters. But such are the quirks behind this impressive open source software that if didn&#8217;t quite do the job.<span id="more-574"></span></p>
<p>I noticed that on the first pass into the database, MySQL did encode the HTML code to Chinese perfectly. When I retrieved the entry up for editing, the text appears in Chinese characters too. Impressive! Then, I switched to code view, and I realised that it didn&#8217;t switch to ascii code!</p>
<p>I did a short google, and I found the hack to make WordPress display Chinese characters correctly.</p>
<p>In the file wp-config.php, just comment out the lines -&gt;</p>
<p><code><font color="#0000ff">define('</font><font color="#000000">DB_CHARSET</font><font color="#0000ff">', '</font><font color="#000000">utf8</font><font color="#0000ff">');</font><br />
<font color="#0000ff"> define('</font><font color="#000000">DB</font><font color="#000000">_COLLATE</font><font color="#0000ff">', '');</font></code></p>
<p>Voila! And your WordPress can now display Chinese characters.</p>
<div style="padding-top:5px;padding-right:0px;padding-bottom:5px;padding-left:0px;;">
											<iframe
												style="height:25px !important; border:0px solid gray !important; overflow:hidden !important; width:550px !important;" frameborder="0" scrolling="no" allowTransparency="true"
												src="http://www.linksalpha.com/social?blog=abanghazrul.com&link=http%3A%2F%2Fwww.abanghazrul.com%2Fnotes%2Fgetting-wordpress-to-encode-non-roman-characters-properly%2F&title=Getting+Wordpress+to+encode+non-Roman+characters+properly&desc=I+thought+that+leaving+WordPress%27s+database+charset+to+UTF-8+would+allow+WordPress+to+display+Chinese+characters+properly.+UTF-8+is+the+file+format+to+encode+East+Asian+characters+anyway.+Even+during+&fc=333333&fs=trebuchet+ms&fblname=like&fblref=facebook&fbllang=en_US&fblshow=1&fbsbutton=1&fbsctr=1&fbslang=en&fbsendbutton=1&twbutton=1&twlang=en&twmention=&twrelated1=&twrelated2=&twctr=1&lnkdshow=noshow&lnkdctr=1&buzzbutton=1&buzzlang=en&buzzctr=1&diggbutton=1&diggctr=1&stblbutton=1&stblctr=1&g1button=1&g1ctr=1&g1lang=en-US">
											</iframe>
										</div>]]></content:encoded>
			<wfw:commentRss>http://www.abanghazrul.com/notes/getting-wordpress-to-encode-non-roman-characters-properly/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
	</channel>
</rss>

