title: how to correctly display double quotations using PHPWord?
body: <p>well I have been banging my head against the wall trying to fix this for a couple of months already. I have a legacy MySQL database which can be described as character hell. After a lot of work I was able to fix all of the incorrectly displayed characters and made everything UTF-8(tables, collation, connection to db, headers, etc).</p>
  
  <p>Now the problem is that when I try to create a Word Document using PHPWord, the double quotations(") appear as its html entity equivalent <code>&amp;quot;</code>. That is the only obstacle between me an victory so, if there's any ideas I'll be very thankfull.</p>
  
  <p>Here is the code:</p>
  
  <pre><code>include_once "../PHPWord.php";
  include_once "../debug.php";
  
  $file_name = "filename.docx";
  header("Cache-Control: public");
  header("Content-Description: File Transfer");
  header("Content-Disposition: attachment; filename=$file_name");
  //header("Content-Type: application/vnd.openxmlformats-officedocument.wordprocessingml.document");
  header("Content-Type: application/vnd.ms-word; charset=utf-8");
  header("Content-Transfer-Encoding: binary");
  
  $index = 1218;
  $mysqli = new mysqli("host","user","pass","database");
  $mysqli-&gt;set_charset("utf8");
  $qry1 = "SELECT * FROM table WHERE index = $index ORDER BY field DESC";
  $qry2 = "SELECT * FROM table2 WHERE index = $index";
  
  $PHPWord = new PHPWord();
  $section = $PHPWord-&gt;createSection();
  
  $section-&gt;addText("Connection Encoding: ".$mysqli-&gt;character_set_name());
  $section-&gt;addText("resuls");
  
  $res1 = $mysqli-&gt;query($qry1);
  while($row = $res1-&gt;fetch_assoc()){
      $section-&gt;addText($row[name]);
      $section-&gt;addText(mb_detect_encoding($row['name']));
  }
  
  $section-&gt;addText("results2");
  
  $res2 = $mysqli-&gt;query($qry2);
  while($row = $res2-&gt;fetch_assoc()){
      $section-&gt;addText(trim($row['title']));
      $section-&gt;addText(mb_detect_encoding($row['title']));
  }
  
  $objWriter = PHPWord_IOFactory::createWriter($PHPWord,'Word2007');
  $objWriter-&gt;save('php://output');
  exit;
  </code></pre>
  
  <p>The result, something like this: </p>
  
  <pre><code>book:&amp;quot;Book Title&amp;quot;
  </code></pre>
  
  <p>So far I've tried a lot of functions and solutions including PHP functions like html_entity_decode, escape characters, and modified PHPWord files to prevent them to try and re-encode the text when adding it to the output.</p>
  
  <p>Thanks in advance.</p>