title: strange character encoding of stored data , old script is showing them fine new one doesn't
body: <p>I'm trying to rewrite an old website .<br>
  it's in persian which uses perso/arabic characters .</p>
  
  <pre class="lang-sql prettyprint-override"><code>CREATE DATABASE `db` DEFAULT CHARACTER SET utf8 COLLATE utf8_persian_ci;
  USE `db`;
  </code></pre>
  
  <p>Almost all my table/columns COLLATE are set to <code>utf8_persian_ci</code></p>
  
  <p>I'm using codeigniter for my new script and i have</p>
  
  <pre><code>'char_set' =&gt; 'utf8',
  'dbcollat' =&gt; 'utf8_persian_ci',
  </code></pre>
  
  <p>In the database settings  , so there is no  problem there .</p>
  
  <p>So here is the strange part </p>
  
  <p>The old script is using some sort of database engine called <code>TUBADBENGINE</code> or <code>TUBA DB ENGINE</code> ... nothing special .</p>
  
  <p>When i enter some data in the database (in persian) using the old script , when i look into database , characters are stored like <code>Ø¹Ù…Ø±Ø§Ù†</code>  .</p>
  
  <p>The old script fetch/shows that data fine , but the new script shows them with the same weird font/charset as database </p>
  
  <p>So when i enter <code>اااا</code> ,  database stored data looks like <code>Ø¹Ù…Ø±Ø§Ù</code> , when i fetch it in the new script i see  <code>Ø¹Ù…Ø±Ø§Ù</code> but in  the old script i see <code>اااا</code></p>
  
  <pre class="lang-sql prettyprint-override"><code>CREATE TABLE IF NOT EXISTS `tnewsgroups` (
    `ID` int(11) NOT NULL AUTO_INCREMENT,
    `fName` varchar(200) COLLATE utf8_persian_ci DEFAULT NULL,
    PRIMARY KEY (`ID`)
  ) ENGINE=InnoDB  DEFAULT CHARSET=utf8 COLLATE=utf8_persian_ci AUTO_INCREMENT=11 ;
  
  --
  -- Dumping data for table `tnewsgroups`
  --
  
  INSERT INTO `tnewsgroups` (`ID`, `fName`) VALUES
  (1, 'Ø¹Ù…Ø±Ø§Ù†'),
  (2, 'Ù…Ø¹Ù…Ø§Ø±ÛŒ'),
  (3, 'Ø¨Ø±Ù‚'),
  (4, 'Ù…Ú©Ø§Ù†ÛŒÚ©'),
  (5, 'test'),
  (6, 'test2');
  </code></pre>
  
  <hr>
  
  <p>In the other hand when i enter <code>ااااا</code> directly in the database </p>
  
  <p>Of course i have the same <code>اااا</code> stored in the database</p>
  
  <p>The new script is showing it fine </p>
  
  <p>But in the old script i get <code>????</code></p>
  
  <p>Can anyone make any sense of this ? </p>
  
  <p>Here is the tuba engin </p>
  
  <p><a href="https://github.com/maxxxir/mz-codeigniter-crud/blob/master/tuba.php" rel="nofollow">https://github.com/maxxxir/mz-codeigniter-crud/blob/master/tuba.php</a></p>
  
  <p>Usage example from old script : </p>
  
  <pre><code>define("database_type" , "MYSQL");
  define("database_ip" , "localhost");
  define("database_un" , "root");
  define("database_pw" , "");
  define("database_name" , "nezam2");
  define("database_connectionstring" , "");
  $db = new TUBADBENGINE(database_type , database_ip , database_un , database_pw , database_name , database_connectionstring);
  $db-&gt;Select("SELECT * FROM tnews limit 3");
  if ($db-&gt;Lasterror() != "") { echo "&lt;B&gt;&lt;Font color=red&gt;ÎØÇ ! áØÝÇ ãÌÏøÏÇ ÊáÇÔ ˜äíÏ";  exit(); }
  for ($i = 0 ; $i &lt; $db-&gt;Count() ; $i++) {
      $row = $db-&gt;Next();
      var_dump($row);
  }
  </code></pre>