Your fix doesn't work with PHP 8.3 and MSSQL 2022. The fix I found was to run this command.
$descriptionformatted = mb_convert_encoding($descriptionformatted, 'UTF-8', 'CP1252');
This thread has more information.
why MSSQL SERVER return question marks, when I execute query in PHP?