title: How can i setting utf-8 to csv file in php [codeigniter]
body: <pre><code>public function ExportCSV(){
      $this-&gt;load-&gt;dbutil();
      $this-&gt;load-&gt;helper('file');
      $this-&gt;load-&gt;helper('download');        
      $delimiter = ",";
      $newline = "\r\n";
      $slash = "∕";
      $filename = "testnaja.csv";
      $query = "select * from student where room_id = 011";
      $result = $this-&gt;db-&gt;query($query);
      $data = $this-&gt;dbutil-&gt;csv_from_result($result, $delimiter, $newline);               
      force_download($filename, $data);
  }    
  </code></pre>
  
  <p>I want to generate excel file exporting data from my table to it.<br>
  The output in .xls and .csv</p>
  
  <p>In csv output is:</p>
  
  <p><a href="https://i.stack.imgur.com/72jVh.png" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/72jVh.png" alt="enter image description here"></a></p>
  
  <p>Please help. Thanks.</p>