Character encoding

For questions and problems with the CMS core. This board is NOT for any 3rd party modules, addons, PHP scripts or anything NOT distributed with the CMS made simple package itself.
Post Reply
the_obs
Forum Members
Forum Members
Posts: 29
Joined: Wed May 05, 2010 10:49 am

Character encoding

Post by the_obs »

Hey all!
I just updated my website's CMS from 1.2.5 to 1.8.2, and am having some problems with character encoding. My frontend is in french, and all accents have been converted (and displayed on the website) in the following form:
é becomes é
è becomes è
â becomes â
à becomes Ã

What gives?

EDIT: By the way, they are stored in the SQL database as they are displayed on the website (é, etc.), and utf-8 encoding is selected in the CMS Made Simple admin console.
Last edited by the_obs on Mon Sep 06, 2010 3:46 pm, edited 1 time in total.
alby

Re: Character encoding

Post by alby »

the_obs wrote: What gives?
You can try to switch $config['set_names'] in config.php but remember that new versions are more close to utf8

Alby
User avatar
Charles Butcher
Forum Members
Forum Members
Posts: 103
Joined: Sat Jul 05, 2008 8:25 pm

Re: Character encoding

Post by Charles Butcher »

I had the same issue a couple of upgrades back, and was planning to convert my database to utf-8 following the discussion here:

http://forum.cmsmadesimple.org/index.php/topic,15578.0.html

But with the next release the problem went away :-\
the_obs
Forum Members
Forum Members
Posts: 29
Joined: Wed May 05, 2010 10:49 am

Re: Character encoding

Post by the_obs »

Thank you for your responses.
Alby, your solution did it, thank you very much. Although I don't quite understand what the problem was: was it that the text in my DB isn't encoded in UTF-8?
replytomk3

Re: Character encoding

Post by replytomk3 »

the_obs wrote: was it that the text in my DB isn't encoded in UTF-8?
It's not, which is stupid.
the_obs
Forum Members
Forum Members
Posts: 29
Joined: Wed May 05, 2010 10:49 am

Re: [Solved] Character encoding

Post by the_obs »

So it IS encoded in UTF-8?  ??? ???
replytomk3

Re: [Solved] Character encoding

Post by replytomk3 »

To find out the encoding, open the database in PHPMyAdmin, and look at the encoding listed for tables. That's what you specify on step 6 (?), or config.php.
alby

Re: [Solved] Character encoding

Post by alby »

the_obs wrote: So it IS encoded in UTF-8?  ??? ???
DB can be utf-8 but your communication (phpmysql) can be other (default for mysql is latin1).
For max compatibility is necessary that your DB is utf-8 AND you must communicate with utf-8

set-names config force your communication in utf8 but if you entered your data in non-utf8 when you retrieve your data you see wrong chars

Alby
Last edited by alby on Tue Aug 31, 2010 2:30 pm, edited 1 time in total.
the_obs
Forum Members
Forum Members
Posts: 29
Joined: Wed May 05, 2010 10:49 am

Re: [Solved] Character encoding

Post by the_obs »

I am still getting problems which I think are character encoding-related.
For example, months in various drop down menus in modules are displayed wrong (august in french is "août" and is displayed with the û as a white interoggation mark in a black diamond).

I think this may also be causing the problems I'm having with a module (see thread [url=http://"http://forum.cmsmadesimple.org/index.php/topic,47069.0.html"]here[/url]), where smarty wrongly compiles a GCB into php.

How can I fix this? If the data in my DB isn't encoded in UTF-8, which encoding is it in?
replytomk3

Re: Character encoding

Post by replytomk3 »

Like I said many times, database is encoded in what phpMyAdmin says, not what any settings say. Open phpMyAdmin and see the encoding listed for tables.
the_obs
Forum Members
Forum Members
Posts: 29
Joined: Wed May 05, 2010 10:49 am

Re: Character encoding

Post by the_obs »

phpmyadmin says:
MySQL charset: UTF-8 Unicode (utf8)
MySQL connection collation: utf8_bin

And then in the actual DB, some tables have utf8-bin collation, but most have latin1_german1_ci collation.
Does this mean my DB isn't (entirely) in UTF8 and should be converted?

I actually just imported the DB from another older install of CMSMS, how come I suddenly have problems?
replytomk3

Re: Character encoding

Post by replytomk3 »

I have documented this at length.

On step 7 (methink), or in config.php your setting should be
latin1_german1_ci

and not utf anything.
Post Reply

Return to “CMSMS Core”