Page 1 of 1

Character encoding

Posted: Mon Aug 30, 2010 11:40 am
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.

Re: Character encoding

Posted: Mon Aug 30, 2010 4:23 pm
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

Re: Character encoding

Posted: Mon Aug 30, 2010 6:39 pm
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 :-\

Re: Character encoding

Posted: Mon Aug 30, 2010 7:29 pm
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?

Re: Character encoding

Posted: Mon Aug 30, 2010 11:12 pm
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.

Re: [Solved] Character encoding

Posted: Tue Aug 31, 2010 8:29 am
by the_obs
So it IS encoded in UTF-8?  ??? ???

Re: [Solved] Character encoding

Posted: Tue Aug 31, 2010 10:42 am
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.

Re: [Solved] Character encoding

Posted: Tue Aug 31, 2010 2:26 pm
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

Re: [Solved] Character encoding

Posted: Mon Sep 06, 2010 3:45 pm
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?

Re: Character encoding

Posted: Mon Sep 06, 2010 8:08 pm
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.

Re: Character encoding

Posted: Thu Sep 09, 2010 4:44 pm
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?

Re: Character encoding

Posted: Thu Sep 09, 2010 10:18 pm
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.