I work on a big website on a Linux server (PHP) and with a SQL Server database.
The SQL Server database uses collation SQL_Latin1_General_CP1_CI_AS
.
I have a table (let us call it table1
) that stores a lot of addresses who are selected from nominatim via a PHP script (script1) and stored in table1. It seems like the format of the addresses is HTML. The Danish letters (æøå) look fine on the website when selected from table1
.
However I have made a PHP script (script2) that selects these addresses and dump them into another table (table2
) on the same MS SQL Server (still collation SQL_Latin1_General_CP1_CI_AS
). But the Danish letters look weird on the website when selected from table2
. When script1 gets addresses from nominatim it is in JSON format, which is afterwards decoded.
$addressdetails = json_decode ( $addressdetails, true );
No other encodes or decoding is made here.
The following may also be a help. When I run phpinfo()
I can see that the server has these settings:
PHP version 5.3.3
content type: text/html; charset=UTF-8
What is the best way to handle letters in PHP and SQL Server, so Danish and other special letters are shown the correct way on any platform?