title: tabbed char in UTF8
body: <p>I am trying to create xls file output of my mysql table and i need UTF8 encoding of file export.php because of slovakian chars - ľ č š ť ž ý ... but when i convert it to UTF8 my script cant print \t character</p>
  
  <pre><code>// part of export.php
  
  header("Content-Type: application/xls");
  header("Content-Disposition: attachment; filename=export.xls");
  header("Pragma: no-cache");
  header("Expires: 0");
  $sql = ("select * from zakaznici");
  $db-&gt;query("SET NAMES 'utf8'");
  
  if (!$result = $db-&gt;query($sql))
  {
      die('There was an error running the query [' . $db-&gt;error . ']');
  }
  
  // define separator (defines columns in excel &amp; tabs in word)
  
  $sep = "\t"; //tabbed character
  
  // start of printing column names as names of MySQL fields
  
  $finfo = $result-&gt;fetch_fields();
  
  foreach($finfo as $val)
  {
      printf("%s\t", $val-&gt;name);
  }
  
  print ("\n");
  $schema_insert = "";
  
  while ($ser = $result-&gt;fetch_assoc())
  {
      $id = $ser['id'];
      $email = $ser['email'];
      $password = $ser['pass'];
      $schema_insert.= $id . $sep . $email . $sep . $password;
      print ("\n");
  }
  
  $schema_insert = str_replace($sep . "$", "", $schema_insert);
  $schema_insert = preg_replace("/\r\n|\n\r|\n|\r/", " ", $schema_insert);
  $schema_insert.= "\t";
  print (trim($schema_insert));
  print "\n";
  </code></pre>
  
  <p>\n character works fine .. only \t with UTF8 doesnt work
  thank you for help</p>