I can\'t seem to get data from MSSQL encoded as UTF-8 using FreeTDS extension.
Connecting:
ini_set(\'mssql.charset\', \'UTF-8\');
$this->_resource
I used same as above but windows 1250, so:
$query = $this->db->query($sql);
$result = $query->fetchAll(PDO::FETCH_OBJ);
foreach ($result as $row) {
foreach (get_object_vars($row) as $key => $value) {
$row->$key = (mb_detect_encoding($value, mb_detect_order(), true) === 'UTF-8')
? $value : iconv('windows-1250', 'utf-8', $value);
}
$results[] = $row;
}
And then it worked, but I use polish characters