It is required that you store all your data in Unicode format (UTF-8). New installations must be performed into databases that have their default character set as Unicode. If you are upgrading, you should perform the UTF-8 migration process (see the Admin page).
I have checked and double checked the database and I AM using Unicode, and all of my other databases are working fine. I don't know a lot about PHP coding but I am willing to give it a try. Does anyone have a solution for this?
CR,
The solution, I believe, is to find a host that is not allergic to Unicode, or convince them to let you have a genuine UTF-8 database. See Moodle Tracker issue http://tracker.moodle.org/browse/MDL-11743. Be sure to read the comments before concluding that your database is really UTF-8. There you will find the SQL query that you need to run to confirm this, one way or the other.
RLE
ALTER DATABASE moodle DEFAULT CHARACTER SET utf8 COLLATE utf8_unicode_ci; Is there any special security concern or anything that would concern a typical hosting company to run database in UTF-8? Just curious..
WHC,
You have just proved that you have not read the comments in the Tracker issue I referenced in my earlier post. If you had, you would have found that the SQL query you suggest is exactly what the victims of these so-called hosts used, but somehow the host system either didn't allow it to work properly, or undid its effect.
As to your "Why?" question, you'll have to ask BlueHost.com and HostMonster.com. All their victims await their response.
CR,
As I said before, the only possible solutions are
- get your web host to change their policy (unlikely), or
- switch hosts!
RLE
SELECT DEFAULT_COLLATION_NAME
FROM information_schema.SCHEMATA
WHERE SCHEMA_NAME = 'database_name';
I have created MDL-12062 for those who may wish to vote/watch it.
Peace - Anthony
mysql> SHOW LOCAL VARIABLES LIKE 'character%';
+--------------------------+------------------------------------+
| Variable_name | Value |
+--------------------------+------------------------------------+
| character_set_client | latin1 |
| character_set_connection | latin1 |
| character_set_database | latin1 |
| character_set_filesystem | binary |
| character_set_results | latin1 |
| character_set_server | latin1 |
| character_set_system | utf8 |
| character_sets_dir | /opt/openpkg/share/mysql/charsets/ |
+--------------------------+------------------------------------+
How can I fix that?
Thanks!
I can list all these tables with
SHOW TABLE STATUS WHERE Collation != 'utf8_general_ci';
and correct each single table with
ALTER TABLE <table_name> CHARACTER SET utf8 COLLATE utf8_general_ci;
but I'm currently not aware of a way to alter them all at once. Did you also handle this?
Best,
rob.
ALTER TABLE <table_name> CHANGE <column_name> <column_name> <type> CHARACTER SET utf8 COLLATE utf8_general_ci <null_or_not>
does not seem to make sense. This would be a pain. Did you care about these? I think I will let them as they are and just update my 1.8 Moodle to 1.9.
best,
rob.
Thanks for all of your work on this issue. I'm a high school teacher who can tinker a little with code but I am certainly no programmer. I decided to go with Hostmonster because they advertise Moodle support right on their website. I really want to start using Moodle with my classes so I hope this issue can be resolved soon. Thanks again.
Chris