I have a SQL Server table that contains country names translated into various languages. I am attempting to display this in a web page. However, what is stored in the database as Amérique du Nord
comes out in PHP as Amérique du Nord
My PDO connection string is
sqlsrv:SERVER=<SERVER>;DATABASE=<DATABASE>
There is no charset option for SQL Server, but the default according to the documentation is UTF-8.
I have tried casting the column to varbinary
, but that just gives me an ascii number that I have not been able to convert to a character. I have also tried a few variations of mb_character_encode which ended up making the characters Chinese.
For additional information:
I am on IIS 7.5, running PHP through FastCGI.
The script is sending the utf-8 header.
On other areas of the same page, I am successfully outputting UTF-8 that I am reading in from a .po file. Only text from the database query is mis-encoded.