use SET NAMES UTF8 rather than unconditional utf8_encode

This commit is contained in:
till busch 2015-05-11 09:04:37 +02:00
parent cb890440ba
commit ab89843609
1 changed files with 2 additions and 1 deletions

View File

@ -75,6 +75,7 @@ class OC_USER_SQL extends OC_User_Backend implements OC_User_Interface
try
{
$this -> db = new PDO($dsn, $this -> sql_username, $this -> sql_password);
$this -> db -> query("SET NAMES UTF8");
$this -> db_conn = true;
} catch (PDOException $e)
{
@ -422,7 +423,7 @@ class OC_USER_SQL extends OC_User_Backend implements OC_User_Interface
} else
{
OC_Log::write('OC_USER_SQL', "User exists, return true", OC_Log::DEBUG);
$displayName = utf8_encode($row[$this -> sql_column_displayname]);
$displayName = $row[$this -> sql_column_displayname];
return $displayName; ;
}
return false;