title: Kohana 3 + PhpExcel problem with xls export
body: <p>I have integrated PHPExcel library with Kohana 3, and have some problem wiht output xls file. When I tried create xls file on server (save on server file system) everything is all right, but when i tried output it with header(), than file is corrupted and show me in Excel some weird characters.</p>
  
  <p>My code in controller/action_index:</p>
  
  <pre><code>$this-&gt;auto_render = FALSE;
  
  $objPHPExcel = new PHPExcel();
  $objPHPExcel-&gt;setActiveSheetIndex(0)
       -&gt;setCellValue('A1', 'Hello world!');
  
  $type = 'xls';
  $mimes = Kohana::config('mimes');
  $mime = $mimes[$type][0];
  
  $this-&gt;request-&gt;headers['Content-Type'] = "$mime; charset=utf-8;";
  $this-&gt;request-&gt;headers['Content-Disposition'] = 'attachment;filename="01simple.xls"';
  $this-&gt;request-&gt;headers['Cache-Control'] = 'max-age=0';
  
  $objWriter = PHPExcel_IOFactory::createWriter($objPHPExcel, 'Excel5');
  $objWriter-&gt;save("php://output");`
  </code></pre>
  
  <p>Thank you for help and sorry for my english.</p>
  
  <p>PS: when i try output pdf same way, everything looks all right, problem is only with xls and xlsx...</p>