title: php-excel-reader - problem with UTF-8
body: <p>I'm using <a href="http://code.google.com/p/php-excel-reader/" rel="noreferrer">php-excel-reader</a> 2.21 for converting XLS file to CSV. I wrote a simple script to do that, but I have some problems with unicode characters. It does not return values from some cells.</p>
  
  <p>For example it doesn't have problems with cell content <code>ceník položek</code> but have problems with <code>nákup</code>, <code>VÝROBCE</code>, <code>PÁS</code>, <code>HRUBÝ</code>,<code>NÁKLADNÍ</code> and some others. In these cells it returns empty value (<code>""</code>).</p>
  
  <p>Here is the code snippet I use for conversion:</p>
  
  <pre><code>&lt;?php    
  set_time_limit(120);    
  require_once 'excel_reader2.php';    
  $data = new Spreadsheet_Excel_Reader("cenik.xls", false, 'UTF-8');    
  
  $f = fopen('file.csv', 'w');    
  for($row = 1; $row &lt;= $data-&gt;rowcount(); $row++)    
  {    
      $out = '';    
      for($col = 1; $col &lt;= $data-&gt;colcount(); $col++)    
      {    
          $val = $data-&gt;val($row,$col);
  
          // escape " and \ characters inside the cell    
          $escaped = preg_replace(array('#”#u', '#\\\\#u', '#[”"]#u'), array('"', '\\\\\\\\', '\"'), $val);    
          if(empty($val))    
              $out .= ',';    
          else    
              $out .= '"' . $escaped . '",';    
      }
      // remove last comma (,)    
      fwrite($f, substr($out, 0, -1));    
      fwrite($f, "\n");
  }
  fclose($f);
  
  ?&gt;
  </code></pre>
  
  <p>Note that the cell and row indexes starts from 1. Any suggestions?</p>