MODx Bug/Feature Tracker and Feature Requests
Welcome to the MODx CMS Tracker. Please choose the appropriate project from the drop down menu and provide as much information as possible regarding your server environment and browser. Thanks!
FS#244 — Wrong character set interpretation during storing to the database
Attached to Project —
MODx
Opened by Robert Zelnik (rzelnik) - Wednesday, 01 February 2006, 02:38PM
Last edited by Jason Coward (opengeek) - Friday, 12 January 2007, 02:09PM
Opened by Robert Zelnik (rzelnik) - Wednesday, 01 February 2006, 02:38PM
Last edited by Jason Coward (opengeek) - Friday, 12 January 2007, 02:09PM
| Task Type | Bug Report |
|---|---|
| Category | Core Distribution |
| Status | Closed |
| Assigned To |
Jason Coward (opengeek) Garry Nutting (garryn) |
| Operating System | All |
| Severity | High |
|---|---|
| Priority | High |
| Reported Version | 0.9.1 |
| Due in Version | 0.9.6 |
| Due Date | Undecided |
| Percent Complete |
|
Details
I would like to create a site on MODx in UTF-8 charset, but some non-ascii characters are scrambled. I cannot store correctly these characters used in Slovak language: ľščťžýáíéóú.I have found some hack that not solve the problem, but maybe it will help to find it.
I tried this:
1. I set up a correct utf8 collation in MySQL for modx_site_content table (utf8_slovak_ci - may be also utf8_general_ci or any other utf8_*, it doesn't matter)
2. I set System configuration > character encoding to Unicode-UTF8
3. I replaced a "iso-8859-1" by "[(etomite_charset)]" in the site template
4. I inserted this line:
mysql_query("SET CHARACTER SET utf8");
on line 63 - after "$this->isConnected = true;"
in the manager/includes/extenders/dbapi.mysql.class.inc.php
5. I edited the text in modx_site_content directly in phpMyAdmin
With this hack the text corectly inserted via phpMyAdmin is displayed correctly on the frontend, but in manager it is still scrambled. When I edit it via backend manager, it is stored to the database scrambled and the frontend show it scrambled the same way as it is in the database. So IMHO the problem is a wrong character set interpretation in both ways (MODx to MySQL and MySQL to MODx).
I use
MODx 0.9.1 rev 646
PHP Version 5.0.2
Mozilla Firefox 1.0.7
MySQL 4.1.5-gamma (collation set to utf8_slovak_ci)
Mandrakelinux 10.1
This task depends upon
This task blocks these from closing
I am using MODx 0.9.2
PHP 5.0.4
MySQL 4.1.12a , collation utf8_general_ci
Windows
mysql_query("SET CHARACTER SET utf8");
after: mysql_select_db($dbase);
in: manager/index.php
- Field changed: Status (Assigned → Duplicate)
- Field changed: Due in Version (0.9.5 → 0.9.6)
- Field changed: Percent Complete (0% → 100%)
This is addressed in a related bug report.