I have two Ubuntu servers:
Server 1 - Ubuntu 16.04.5, PHP 7.0.32
Server 2 - Ubuntu 14.04.5, PHP 7.2.9
Issue:
Server 1 prints out special characters but Server 2 prints out the dreaded black diamond replacement character.
Findings:
I am not sure where else to check. I know this has been asked before but each solution I find has not helped thus far. Does it have something to do with either the PHP version or Ubuntu version? What else can I check that I may have missed? Thanks for the help.
Edit 1
The code is just a test file with a select statement and echoing the result. This was merely created to find the issue so I can correct in the actual project.
Long story short, I have users that type out their hearing findings in word first and then copy and paste into the program. Unfortunately I have no way around that.
Here are a few string examples of what is getting printed out.
Server 1: with a retail–oriented
Server 2: with a retail�??oriented
Server 1: Flanagan │ Bilton, LLC
Server 2: Flanagan �?? Bilton, LLC
Server 1: Class “C” drugstore
Server 2: Class �??C�?? drugstore
Edit 2
Still looking for some help so here is the test code being used from each ubuntu server to the one MSSQL server.
$conn = connect();
$sql = "select ltrim(rtrim(additionalinformation)) as 'text' from tblsmdecision where petitionid = 4559";
$stmt = $conn->prepare($sql);
$stmt->execute();
$row = $stmt->fetch();
echo $row['text'];
function connect()
{
$host = 'xxx';
$db = 'xxx';
$user = 'xxx';
$pass = 'xxx';
$conn = new PDO("dblib:host=$host; dbname=$db", "$user", "$pass");
return $conn;
}