title: PHP json_encode() function and Persian language
body: <p>I'm converting a website database to Joomla's K2 component database.
  in K2 there is a extra_fields columns that user can create custom fields, similar as Drupal's CCK. So I used this feature to keep item's source in a field.
  <code>{"id":"7", "value":"Text"}</code>
  but when I use to json_encode "ارتباطات و اطلاع رساني" or anything else instead of getting</p>
  
  <p><code>{"id":7,"value":"\u0627\u0631\u062a\u0628\u0627\u0637\u0627\u062a \u0648 \u0627\u0637\u0644\u0627\u0639 \u0631\u0633\u0627\u0646\u064a"}</code></p>
  
  <p>that I see in my localhost, I have:</p>
  
  <p><code>{"id":"7","value":"u0631u0648u0627u0628u0637 u0639u0645u0648u0645u064a"}</code>, when data is inserted to database</p>
  
  <p>UPDATE: </p>
  
  <ul>
  <li><p>There is no slashes in what I'm trying to json_encode</p></li>
  <li><p>I have wrote a php code to read from a table and then convert data and insert them in another table</p></li>
  <li><p>script which I use to create json_encoded data from my source is:</p>
  
  <pre><code>if($this-&gt;source[$i]){
          $this-&gt;source[$i] = trim($this-&gt;source[$i]);
          $this-&gt;extrafield[$i] = array("id"=&gt;"7", "value"=&gt;$this-&gt;source[$i]);
          $this-&gt;extrafield[$i] = json_encode($this-&gt;extrafield[$i]);
  }
  </code></pre></li>
  </ul>
  
  <p>UPDATE 2:</p>
  
  <p>I think I solved my own problem. check the answer.</p>