title: A problem with passing Japanese characters(UTF-8) via json_encode
body: <p>I'm having a trouble transferring Japanese characters from PHP to JavaScript via json_encode. </p>
  
  <p>Here is the raw data read from csv file.</p>
  
  <pre><code>PRODUCT1,QA,テスト
  PRODUCT2,QA,aテスト
  PRODUCT3,QA,1テスト
  </code></pre>
  
  <p>The problem is that when passing those data by echo json_encode($return_value), where $return_value is a 2-dimentional array containing above data, the Japanese word 'テスト' gets dropped and shown as empty string on the ajax response side. However, if I put any alphabetical/digital chars at the start of the Japanese word, like 'aテスト' or '1テスト' which are the 2nd and 3rd lines of the above example, those words get passed ok.</p>
  
  <p>Below is how the data looks like on the ajax response side. As you can see, the 3rd element of the 1st block is empty. If I remove 'a' or '1' from the other words of the above raw data, those characters become empty on the response side too. This is happening to any kind of Japanese characters I have tested so far.</p>
  
  <pre><code>[["PRODUCT1","QA",""],["PRODUCT2","QA","a\u30c6\u30b9\u30c8"],["PRODUCT3","QA","1\u30c6\u30b9\u30c8"]]
  </code></pre>
  
  <p>Does anybody have any idea why this is happening and how I can overcome this problem?</p>
  
  <p>Here is a part of the code from each side.</p>
  
  <pre><code> PHP:
   function getFileContents($dirName,$filename){
  
      $return_value = array();
      $my_file= fopen($dirName . $filename, "r");
  
      $row = 0;
      while (($data = fgetcsv($my_file, 1000, ",")) !== FALSE) {
          $num = count($data);
           for ($c=0; $c &lt; $num; $c++) {
              #csv file is written in euc-jp so convert to utf-8 here.
              $return_value[$row][$c] = mb_convert_encoding($data[$c], "UTF-8", "EUC-JP");
           }
           $row++;
      } 
      fclose($my_file);
  
      echo json_encode($return_value);
    }
  
    JavaScript:
    $.ajax({
       type: "POST",
       url: "data.php",
       data: { 
          "dirName" : "./data/",
          "filename" : filename
       },
       dataType :"json",
       success : function(response){
            // more code
            // At this point, Japanese characters are already empty strings.
      } 
    });
  </code></pre>
  
  <p>Thanks a lot for your help in advance!</p>