Linode Forum
Linode Community Forums
 FAQFAQ    SearchSearch    MembersMembers      Register Register 
 LoginLogin [ Anonymous ] 
Post new topic  Reply to topic
Author Message
 Post subject: Database and Chinese
PostPosted: Wed Nov 24, 2010 2:09 am 
Offline
Newbie

Joined: Wed Nov 24, 2010 1:48 am
Posts: 4
Website: http://www.ethansenglishcafe.com
Location: Beijing
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 utf8_general_ci 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/

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?


Top
   
 Post subject:
PostPosted: Wed Nov 24, 2010 9:38 am 
Offline
Senior Member

Joined: Sun Aug 02, 2009 1:32 pm
Posts: 222
Website: https://www.barkerjr.net
Location: Connecticut, USA
You should check where the mysql connection is defined. Here's what I do so I can fetch Chinese text:
Code:
$db = new mysqli('localhost', 'database', null, 'database');
if (mysqli_connect_errno()) {
  $db = null;
} else {
  $db->set_charset('utf8');
}


Top
   
 Post subject:
PostPosted: Thu Nov 25, 2010 1:49 am 
Offline
Newbie

Joined: Wed Nov 24, 2010 1:48 am
Posts: 4
Website: http://www.ethansenglishcafe.com
Location: Beijing
BarkerJr wrote:
You should check where the mysql connection is defined. Here's what I do so I can fetch Chinese text:
Code:
$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?


Top
   
 Post subject:
PostPosted: Thu Nov 25, 2010 2:55 am 
Offline
Senior Member
User avatar

Joined: Sun Dec 27, 2009 11:12 pm
Posts: 1038
Location: Colorado, USA
Might want to google on "wordpress chinese characters" and see what comes up.

http://boringest.blogasian.com/2008/10/ ... wordpress/


Top
   
 Post subject:
PostPosted: Thu Nov 25, 2010 10:18 am 
Offline
Newbie

Joined: Wed Nov 24, 2010 1:48 am
Posts: 4
Website: http://www.ethansenglishcafe.com
Location: Beijing
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.


Top
   
 Post subject:
PostPosted: Thu Nov 25, 2010 2:21 pm 
Offline
Senior Member
User avatar

Joined: Sat Aug 30, 2008 1:55 pm
Posts: 1739
Location: Rochester, New York
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.)

_________________
Code:
/* TODO: need to add signature to posts */


Top
   
 Post subject:
PostPosted: Fri Nov 26, 2010 4:48 am 
Offline
Newbie

Joined: Wed Nov 24, 2010 1:48 am
Posts: 4
Website: http://www.ethansenglishcafe.com
Location: Beijing
hoopycat wrote:
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.


Top
   
Display posts from previous:  Sort by  
Post new topic  Reply to topic


Who is online

Users browsing this forum: No registered users and 2 guests


You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum

Search for:
Jump to:  
RSS

Powered by phpBB® Forum Software © phpBB Group