View Issue Details
ID | Project | Category | View Status | Date Submitted | Last Update |
---|---|---|---|---|---|
0002937 | OXID eShop (all versions) | 4.07. Source code, Test | public | 2011-05-26 17:24 | 2012-12-10 13:44 |
Reporter | Mitmacher | Assigned To | |||
Priority | high | Severity | major | Reproducibility | always |
Status | resolved | Resolution | fixed | ||
Product Version | 4.5.0 revision 34568 | ||||
Fixed in Version | 4.5.2 revision 38481 | ||||
Summary | 0002937: Missing "SET NAMES latin1 " in function getDb() - file /core/oxdb.php | ||||
Description | On some linux servers (e.g. OpenSuse) the default database connection is set to UTF8 which seems to be not changeable by my.cnf. So if you want to use an Oxid-Shop with charset latin1 on such servers, you MUST also use the correct connection charset or german umlauts for example won't work. The best solution may be to extend the source code a little bit like this: if ( $myConfig->isUtf() ) { self::$_oDB->execute( 'SET NAMES utf8' ); } else { self::$_oDB->execute( 'SET NAMES latin1' ); } (I also cleaned up the utf8-code because the other commands are redundant.) Unfortunately this can't be done by writing a modul extension, or am I wrong? | ||||
Steps To Reproduce | - install demo shop with charset latin1 and a mysql db >= 5.1(?) on opensuse 11.3 | ||||
Tags | No tags attached. | ||||
Theme | Both | ||||
Browser | All | ||||
PHP Version | any | ||||
Database Version | 5.1 | ||||
parent of | 0006203 | resolved | mantas.vaitkunas | sDefaultDatabaseConnection config option default value is not set |
|
@developers: check from source code side, if offered solution is correct |
|
Executing "SET NAMES" is a good idea for every connection. However the offered solution is not universal, it fits the use case when default character set is latin1, however it will be wrong in case default charset is something else than latin1 (different language than western European). It means the "SET NAMES" charset is variable and should be supplied as a variable. I see 2 possible solutions for the given problem: 1. Treat it as a feature request. But probably we need to update system requirements and sysrequirement check in this case. OR 2. Introduce a config.inc.php variable for "SET NAMES" instruction. @quality, please decide. |
|
added parameter $this->sDefaultDatabaseConnection = ''; where you can set charset |