Strange Garbage Character in SQL server database like ÂÃÂÃÂÃÂÃÂÃÂÃÂÃ I am using HTMLBOX editor for getting Notes/RichText Data input from User. I found there are lot of garbage characters in my database and they keep on doubling on each time user save/update notes. 

Below is code sample for my PHP to SQL server connection. 

&lt;?php
class Model {
    public static $db;

    public static function initialize() {
        self::$db = new PDO('odbc:Driver={SQL Server};Server='.DBCONNECTION_SERVER.';Database='.DBCONNECTION_DATABASE.'; Uid='.DBCONNECTION_USER.';Pwd='.DBCONNECTION_PASS.';', null, null,array(PDO::ATTR_PERSISTENT =&gt; true));
        self::$db-&gt;setAttribute(PDO::ATTR_CASE, PDO::CASE_LOWER);
        self::$db-&gt;setAttribute(PDO::ATTR_ERRMODE, PDO::ERRMODE_EXCEPTION);
        self::$db-&gt;setAttribute(PDO::ATTR_EMULATE_PREPARES , false);
    }
}
?&gt;


I search for same problem and most of solution suggest to use UTF8 encoding. I set below attribute but no success. :(

self::$db-&gt;setAttribute(PDO::SQLSRV_ATTR_ENCODING , PDO::SQLSRV_ENCODING_UTF8);


Please see below screenshot. 


Update:

Column Type : NVARCHAR(MAX)

User Input : User can enter or Copy/paste anything. Those garbage character appears when user copy paste from Outlook or other Rich Text Source. The single quote(') from outlook get converted to (Ã¢ÂÂ) garbage character.
According to the MSDN page for PDO::setAttribute, PDO::SQLSRV_ENCODING_UTF8 is the default value, so setting it explicitly probably wouldn't change the behavior.

Try the other option, PDO::SQLSRV_ENCODING_SYSTEM, which seems to have worked in this case from the MSDN forums: Some characters improperly retrieved through PDO driver.