What should I do to properly store data with special characters (UTF-8) in SQL Server (2014)? My HTML page is encoded in UTF-8, the column in the database table is of type nvarchar, the encoding of the connection is set to UTF-8, but the line
Haïti couplées à la capacité
stored as
慈 꿃 楴 挠 畯 汰 ꧃ 獥 쌠 ₠ 慬 挠 灡 捡 瑩 ꧃
or sometimes
????????????????
in the table. I am using Laravel 5 with a wandering estate. Here are the connection options:
'sqlsrv' => array(
'driver' => 'sqlsrv',
'host' => 'DB_HOST',
'database' => 'DB_DATABASE',
'username' => 'DB_USERNAME',
'password' => 'DB_PASSWORD',
'prefix' => '',
'charset' => 'utf8',
'collation' => 'utf8_unicode_ci',
),
and set the following in freetds.conf:
[global]
tds version = 8.0
client charset = UTF-8
source
share