Saturday, May 19, 2012

Chinese Characters Not Saving in Joomla/WordPress?

Attention: open in a new window.  E-mail

Are you having your problem saving Chinese Characters in Joomla? Where the Chinese characters changes to ????? when you save it?

The most common problem is that the character-set in your database tables are not set as utf8. The simplest solution is to change the database directly. To do this you need access to your cpanel and phpmyadmin.

Changing the collation for all tables in a MySQL database can be time consuming depending on how many tables you have.

That's why we recommend using the following PHP script for changing the collation for all tables at a time:

<code>{<?php
$db = mysql_connect('localhost','myuser_mydbuser','mypassword');
if(!$db) echo "Cannot connect to the database - incorrect details";
mysql_select_db('myuser_mydbname'); $result=mysql_query('show tables');
while($tables = mysql_fetch_array($result)) {
foreach ($tables as $key => $value) {
mysql_query("ALTER TABLE $value COLLATE utf8_general_ci");
}}
echo "The collation of your database has been successfully changed!";
?>
}</code>

Make sure to substitute in the above script:

myuser_mydbname with your database name;

myuser_mydbuser with your mysql username;

mypassword with your password for the mysql user;

utf8-general_ci with your new collation if different;


Andrew Boey
Written on Friday, 07 January 2011 03:44 by Andrew Boey

Viewed 499 times so far.
Like this? Tweet it to your followers!

Rate this article

(0 votes)

Latest articles from Andrew Boey

Latest 'tweets' from YourJoomlaTraining

  • Just Upgraded my MacBook Pro RAM from 4GB to 8GB for US$115 and the memory performance rating was better than stock! Link Sunday, 13 February 2011 21:09
  • Come to "Create Your Online Real Estate - Generate Passive Income and Capital Gains " Friday, February 11 from... http://fb.me/RJlR4Bka Link Monday, 31 January 2011 06:27
  • I posted 20 photos on Facebook in the album "Website Mastery - March 2010" http://bit.ly/bjkO0X Link Tuesday, 23 March 2010 21:22
  • Come to "Website Mastery Intro" Tomorrow from 6:30 pm to 10:00 pm. Website Mastery Intro - Start Your Online Real... http://bit.ly/aeTZAr Link Friday, 05 March 2010 01:02
  • Message: "Register Now! for 3rd Joomla! 101 Intensive - Sat - 17th Oct - 9:00am to 5:30pm" - http://grsnip.com/INPh Link Sunday, 04 October 2009 01:34
blog comments powered by Disqus

Members Login