View Issue Details

IDProjectCategoryView StatusLast Update
0002937OXID eShop (all versions)4.07. Source code, Testpublic2012-12-10 13:44
ReporterMitmacher Assigned To 
PriorityhighSeveritymajorReproducibilityalways
Status resolvedResolutionfixed 
Product Version4.5.0 revision 34568 
Fixed in Version4.5.2 revision 38481 
Summary0002937: Missing "SET NAMES latin1 " in function getDb() - file /core/oxdb.php
DescriptionOn 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
TagsNo tags attached.
ThemeBoth
BrowserAll
PHP Versionany
Database Version5.1

Relationships

parent of 0006203 resolvedmantas.vaitkunas sDefaultDatabaseConnection config option default value is not set 

Activities

birute_meilutyte

2011-06-03 11:01

reporter   ~0004682

@developers: check from source code side, if offered solution is correct

tomas_liubinas

2011-08-01 14:20

reporter   ~0004907

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.

Linas Kukulskis

2011-08-09 13:46

reporter   ~0004972

added parameter $this->sDefaultDatabaseConnection = '';
where you can set charset