Jump to content



Photo

MySQL Database - Chinese character problem


  • Please log in to reply
3 replies to this topic

#1 +chconline

chconline

    I review, not promote.

  • Joined: 20-August 04
  • Location: Calgary, AB, Canada

Posted 06 July 2013 - 17:36

I have a website that has some Chinese characters in it. When I exported the MySQL database backup, everything shows up as garbage. From what I've read online, it's because the original encoding was set as 'latin1' when I'm supposed to use 'utf8'. However, on the front end (Like accessed from web browser), the text on the site shows up just fine.

 

Is there any way I can fix the MySQL database backup to show Chinese characters properly instead of garbage?




#2 farmeunit

farmeunit

    The other white meat.

  • Tech Issues Solved: 2
  • Joined: 05-May 03
  • Location: Branson, MO USA

Posted 06 July 2013 - 18:00

http://www.bluehostf...-latin1-to-utf8

 

Check out post #4.

 

That being said, I'm not sure there is a way to show Chinese properly.  I've only changed to utf8 for different CMSes. 



#3 OP +chconline

chconline

    I review, not promote.

  • Joined: 20-August 04
  • Location: Calgary, AB, Canada

Posted 06 July 2013 - 22:50

Thanks. Didn't work though :s



#4 The_Decryptor

The_Decryptor

    STEAL THE DECLARATION OF INDEPENDENCE

  • Tech Issues Solved: 4
  • Joined: 28-September 02
  • Location: Sol System
  • OS: iSymbian 9.2 SP24.8 Mars Bar

Posted 07 July 2013 - 00:45

Latin1 can't store Chinese characters, so if it ever worked before it was on accident. Try taking just the "garbage" from the SQL dump and (in a web browser or good text editor) try changing the encoding scheme until it works, then you'll know what format it was originally in.

Another thing is that "utf8" in MySQL isn't actually proper UTF-8 support, it's broken. You should use "utf8mb4" if you can.