After encountering some weirdness with a modx install that I'd upgraded from 2.2.9 to 2.2.10 I noticed that the database had two differnt character sets, Utf8-general-ci and Latin-Swedish. I decided to do a fresh install, with the result that I had a new all utf8 database, however when I install addons through package manager the character set of their tables is Latin-Swedish. Is this a problem and if so what can I do so that the packages aren't installed with a different character set to the original package?
Make sure the database itself is set to UTF-8 and so is the encoding in core/config/config.inc.php.
SiteCheck, btw, will do extensive checks for encoding mismatches, though it won't fix them. http://bobsguides.com/sitecheck-tutorial.html
All that said, I have also seen extras that created tables in Latin1. I'm not sure how it happens.
See this for a safe fix: http://bobsguides.com/convert-db-utf8.html
, though if the new tables are empty, it should be safe to just change the settings in PhpMyAdmin. Be sure to change the text fields in addition to the tables.
I wonder if it's possible that when someone creates a table for an extra manually then has the table converted to a schema for packaging that the charset and collation of the manually-created table is used when the package is generated?
The extras that I'm aware of use createObjectContainer(), which would use either the MODX charset or the DB charset -- not sure which.
What happened in my case was that the DB charset was somehow changed back to Latin1 a while back. I suspect that it happened in a server upgrade at the host.
Ironically, this thread prompted me to run SiteCheck again at Bob's Guides. The Quip, Dashboard, and Media Source tables were in Latin1. I just had to run my own database charset converter again on my own site.
It's worth having SiteCheck around just to check this periodically. It would be really easy to fix if you caught it before any new tables were created.
I find it a little difficult to understand why shared hosting providers don't configure the MySQL servers to use utf8 by default. Or why MySQL didn't start using it as the default configuration years ago.
Thanks for he replies. Unfortunately I'm on shared hosting Eoler :-(. Bob I bought Sitecheck and ran it - which is how I realised that packages were being installed with a different character set than the db. When I look in phpMyadmin it says that the default mysql charset is Latin-swedish, Installatron must over-ride/ignore that but anything that is subsequently installed through package manager either must just pick up the default or maybe as Sottwell surmises the originally created charset is used . There are other strange things going on with the installation as well so I'm guessing that it could be something that has changed on their servers.
Yes it's a cpanel plan and when I look in the Operations tab it says the collation is Latin-Swedish - so it looks as though I can't use Installatron to install modx. Is it a major problem if there are two different charsets in there?