Language issue with non-core modules and PHP

The place to talk about things that are related to CMS Made simple, but don't fit anywhere else.
Post Reply
jakovbak
Forum Members
Forum Members
Posts: 234
Joined: Thu Dec 13, 2012 2:54 pm

Language issue with non-core modules and PHP

Post by jakovbak »

Hello everyone!
I have noticed and solved a strange issue but I'm still curious what is causing it... Here's what happened:

- I've created three different websites hosted by three different hosting companies.
- All of the websites are on CMSMS 2.1.3 “Black Point”.
- Croatian letters are displayed correctly on basic installation.
- Croatian letters are NOT displayed correctly within any of the non-core modules (modules installed afterwards, like Gallery, FormBuilder or LISE).
- While checking PHP database I've noticed that every single entry is using "collation: utf8_general_ci" except entries of above mentioned three modules - they were using "collation: utf8_swedish_ci".

Any ideas how or why this could happened? I have no connection with Sweden whatsoever, not even the time zone and I certainly didn't choose Swedish for single module installation because (as far as I know) it is not possible!
And is there a way to change all of the "utf8_swedish_ci" entries all at once? What I did to change it was a lot of manual work because PHP is not my field of expertise. Far, far from it to be honest... :-)

To conclude: All of my actions were just as usual, exactly like dozens of times before but all of a sudden additional modules went off to Sweden for no particular reason. Is it a bug or something else?

Thank you in advance and best regards!
chandra

Re: Language issue with non-core modules and PHP

Post by chandra »

jakovbak wrote: - Croatian letters are NOT displayed correctly within any of the non-core modules (modules installed afterwards, like Gallery, FormBuilder or LISE).
- While checking PHP database I've noticed that every single entry is using "collation: utf8_general_ci" except entries of above mentioned three modules - they were using "collation: utf8_swedish_ci".
Collation could be set by modules on install. If this is no part of install command server default is used.

By the way - MySQL was a swedish company before SUN and now ORACLE owns them. So server default could be utf8_swedish_ci :D.
jakovbak wrote:And is there a way to change all of the "utf8_swedish_ci" entries all at once?
You can do it with a tool like phpmyadmin every server should have. Please look here

https://stackoverflow.com/questions/478 ... -in-one-go
chandra

Re: Language issue with non-core modules and PHP

Post by chandra »

chandra wrote: Collation could be set by modules on install. If this is no part of install command server default is used.
In some of next CMSMS versions CHARACTER SET utf8 and COLLATE utf8_general_ci will be setted as default ;)

http://viewsvn.cmsmadesimple.org/diff.p ... &peg=11041
jakovbak
Forum Members
Forum Members
Posts: 234
Joined: Thu Dec 13, 2012 2:54 pm

Re: Language issue with non-core modules and PHP

Post by jakovbak »

Hello Chandra and thank you for the tips! I did check the links you posted but came up no smarter than before, thou... :-)
What's bugging me is this:
You'll simply need to run an ALTER on each of the tables as follows:

Code: Select all

ALTER TABLE <table name> COLLATE utf8_general_ci;
As far as I can see this is some kind of command I should run in order to change collation but it is still a single-entry solution: run an ALTER on each of the tables?
This is my first dive into databases in this manner and maybe I'm too cautious because I don't want to screw something up. Honestly, I have no idea how to run ALTER, nor where is the tool to do so... So far I did collate changes on every table manually by clicking on table's name, then clicking on "Create PHP code", then selecting every entry with Swedish collation and choosing utf8 from the dropdown menu.
However, even thou I changed all of that, there's still Swedish collation assigned to all of those tables (you can see an example in the attachment).
I did not find any troubles after doing this, it seems everything is working just fine - the website's front-end just and it's back-end are showing characters as they should.
But at the end of the day, after coming that close to learning something new and useful, I would really like to know how to use ALTER on entire database to make such changes as described in this topic...
Thank you in advance and best regards!
Attachments
table_1.jpg
chandra

Re: Language issue with non-core modules and PHP

Post by chandra »

PHPMyAdmin provides a GUI and a command line for altering tables ... you have done it now like suggested on "graphical GUI way" ;).

But it's possible too to do that also with a small php script in one task - but now you don't need it so it's no need to provide such a script here :D
jakovbak
Forum Members
Forum Members
Posts: 234
Joined: Thu Dec 13, 2012 2:54 pm

Re: Language issue with non-core modules and PHP

Post by jakovbak »

Thank you Chandra! One way or another, it's important to get the job done, right? :-)
Best regards and have a nice day!
jakovbak
chandra

Re: Language issue with non-core modules and PHP

Post by chandra »

You're welcome 8) ...
Post Reply

Return to “The Lounge”