Database and Chinese

Hi, probably a newbie question as I'm just starting out on running a server but here's the thing, I moved from a hosted company which was expensive but so simple, to linode as I've been wanting to get into more hands on stuff anyway and it seemed like a good way to kill all my free time.

Moved over to a Linode 512 system, took a while to learn all the bits and pieces of setting it up but it's up and running now on Ubuntu 10.04 and seems to be working well (thank you for the library here, great company this one, ok enough a** kissing) except for one problem.

I moved a wordpress site doing English training for Chinese students onto my new server and transfered the database over using the wpdatabase plugin which just bundles and then unbundles all the information from what I understand. However my database includes lots of Chinese simplified characters to help explain new words, slang and idioms but now those Chinese characters all show up looking like

英语, 英文

At first I assumed it as a collation problem as I am a little new to this but changing it to utf8generalci did nothing and after I read that just decides how it's sorted, not how it's actually displayed and stored.

So my question is, how do I enable double byte characters in my mysql database? Should it be enabled already or is there something I need to change? And if it should already be enabled… um… any ideas why all my Chinese characters wont show?

Thanks a lot for the help!

UPDATE:

So i published a new article which can be seen here

http://www.ethansenglishcafe.com/2010/1 … or-profit/">http://www.ethansenglishcafe.com/2010/11/lying-for-profit/

and some of the Chiense seems to work (you can see it at the bottom of the article, the tags), all of my old Chinese did not work and the strange thing is there seems to be no reason why one character did not work (钱, looks like é’± on that article) which I wrote and another that I wrote (骗子) which i also wrote did work. The other characters I copied from my girlfriend who sent them to me using QQ (Chiense MSN basically) and they all worked….

Any thoughts?

6 Replies

You should check where the mysql connection is defined. Here's what I do so I can fetch Chinese text:

$db = new mysqli('localhost', 'database', null, 'database');
if (mysqli_connect_errno()) {
  $db = null;
} else {
  $db->set_charset('utf8');
}

@BarkerJr:

You should check where the mysql connection is defined. Here's what I do so I can fetch Chinese text:

$db = new mysqli('localhost', 'database', null, 'database');
if (mysqli_connect_errno()) {
  $db = null;
} else {
  $db->set_charset('utf8');
}

Any idea where that would be located? In the Wordpress main files?

Might want to google on "wordpress chinese characters" and see what comes up.

http://boringest.blogasian.com/2008/10/ … wordpress/">http://boringest.blogasian.com/2008/10/how-to-show-chinese-characters-in-wordpress/

Yeah, already did that, but it only talks about how to change the collation which I already did. Still having problems so looking for more help.

I'm wondering if that wpdatabase plugin might not be Unicode-aware… it sounds like the corruption happened on either the export or the import. (This wouldn't be the first time.)

@hoopycat:

I'm wondering if that wpdatabase plugin might not be Unicode-aware… it sounds like the corruption happened on either the export or the import. (This wouldn't be the first time.)

The database is still on my old server, though it's a little out of date now… maybe will trya nd see if transfering manually works better.

Reply

Please enter an answer
Tips:

You can mention users to notify them: @username

You can use Markdown to format your question. For more examples see the Markdown Cheatsheet.

> I’m a blockquote.

I’m a blockquote.

[I'm a link] (https://www.google.com)

I'm a link

**I am bold** I am bold

*I am italicized* I am italicized

Community Code of Conduct