Simplified Chinese characters display as question marks
Permalink 1 user found helpfulWhenever I try to enter Chinese characters in the blocks, the output is a series of question marks.
Is this one of the software's limitations, or is it something I'm dong wrong?
Many thanks in advance to anyone who can help me.
David
Change your database encoding.
Run the following SQL replacing DATABASE with your database name:
ALTER DATABASE DATABASE DEFAULT CHARACTER SET utf8 COLLATE utf8_unicode_ci
$ mysql
> use DATABASE;
> ALTER DATABASE DATABASE DEFAULT CHARACTER SET utf8 COLLATE utf8_unicode_ci
or from PHPMyAdmin (usually through cPanel) or locally:
1. Select the Database (from the left)
2. Click on Operations tab (top right)
3. Goto Collation (at the bottom)
4. Select 'utf8_unicode_ci' and click Go
Tip for others: you have to click on phpMyAdmin in cPanel to get to the place where you can change your databases as referenced by okhayat. Actually, once you are logged into phpMyAdmin, I think you can change the collation for all of your databases at once on the main page--but somebody correct me if I'm wrong about that.
How to do? Thanks in advance.
Could this be a problem with my concrete5 theme?
:(
I then found this script which i placed as a php file in the root of my website and ran it.
http://stackoverflow.com/questions/105572/a-script-to-change-all-ta...
Please make sure you backup your database before trying it and if it goes wrong then you can restore. If you don't backup you might lose everything!!!
The script worked perfectly for me though.
Please help
If not install the package sqlbuddy from Remo as I'm pretty sure it gives you the option to change the collation.
Also make sure you have a backup of the datrabase before you do anything.
Cheers
Al
C5 has a lot of tables to do it manually :)
How should I name my file?
and from below code what do I change? db1 to my DBname? Anything else? Sorry but I am not a php programmer :-)
<?php // your connection mysql_connect("localhost","root","***"); mysql_select_db("db1"); // convert code $res = mysql_query("SHOW TABLES"); while ($row = mysql_fetch_array($res)) { foreach ($row as $key => $table) { mysql_query("ALTER TABLE " . $table . " CONVERT TO CHARACTER SET utf8 COLLATE utf8_unicode_ci"); echo $key . " => " . $table . " CONVERTED<br />"; } } ?>
<?php function MysqlError() { if (mysql_errno()) { echo "<b>Mysql Error: " . mysql_error() . "</b>\n"; } } $username = "root"; $password = ""; $db = "database"; $host = "localhost"; $target_charset = "utf8"; $target_collate = "utf8_general_ci"; echo "<pre>";
Place this in a file called dbupdate.php on your web server. Change the variables username, password and database at the start of the script to what your database expects, i.e. what you used when you installed C5.
browse to the script in your browser, i.e.http://www.yousite.com/dbupdate.php...
Mysql Error: Access denied for user 'oushuie1'@'localhost' (using password: NO)
in dbupdate.php I change the following to:
$username = "admin"; $password = "MyAdminPasswd1234"; $db = "oushuie1_cnc1"; $host = "localhost";
any help would be appreciated.
I'm having problems showing chinese simplified characters.
obvioulsy yoursite.com changes to your url and scriptname changes to what you have called the script in public_html
I would get rid of the script once you have ran it and it's all working.
tail --bytes=+4 file.php
it fixed the issue for some sites, but not the others.
Hope this might help someone who gets stuck with the same issue.
Could anyone give me some help?