samedi 18 avril 2015

MSSQL incorrect charset in php arrays

Need to create connect to mssql from ubuntu with php(laravel). I'm using freetds and sybase mssql adapter for it. Successfully connected to base and can select data from it. But, when i'm trying to get an array of data from table, characters have invalid charset. With one field all is ok.


Here is my freetds.conf



[global]
tds version = 8.0
client charset = UTF-8
text size = 20971520


And laravel database config



'sqlsrv' => array(
'driver' => 'sqlsrv',
'host' => 'some-ip\DB',
'database' => 'DBTEST',
'username' => 'web-testUser',
'password' => 'hereIsMyPassword',
'charset' => 'utf8',
'prefix' => '',
),


And simple function to get an array of data



Route::get('/', function()
{
return var_dump(User::all()); //if i'll try to simple return data without using var_dump it'll crash
});

Aucun commentaire:

Enregistrer un commentaire