title: XmlWorker ParseToElementList UTF-8 special character missing
body: <p>i've modified XMLWorkerHelper.ParseToElementList method so that i'm using UTF-8 encoding for converting attached HTML.</p>
  
  <p><div class="snippet" data-lang="js" data-hide="false" data-console="true" data-babel="false">
  <div class="snippet-code">
  <pre class="snippet-code-html lang-html prettyprint-override"><code>&lt;p&gt;​&lt;span style="font-size: 10pt; font-family: &amp;quot;tahoma&amp;quot;, &amp;quot;sans-serif&amp;quot;"&gt;Med pripravo vozil za ladjo M/V SEA PATRIS, dne 19.02.2017 je prišlo do delovne nezgode in poškodbe dveh vozil Seat Ateca. Voznik ( RETRANS d.o.o.) je z vozilom Seat Ateca VIN: VSSZZZ5FZH6536022 &amp;#160;zapeljal vzvratno in trčil v stoječe vozilo Seat Ateca VIN: VSSZZZ5FZH6545134.&lt;/span&gt; &lt;/p&gt;
  &lt;div&gt;&lt;span style="font-size: 10pt; font-family: &amp;quot;tahoma&amp;quot;, &amp;quot;sans-serif&amp;quot;"&gt;&amp;#160;&lt;/span&gt;&lt;/div&gt;
  &lt;div&gt;&lt;span style="font-size: 10pt; font-family: &amp;quot;tahoma&amp;quot;, &amp;quot;sans-serif&amp;quot;"&gt;Priloge: fotografije, seznam poškodb&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160; &lt;/span&gt;&lt;/div&gt;
  &lt;div&gt;&lt;span style="font-size: 10pt; font-family: &amp;quot;tahoma&amp;quot;, &amp;quot;sans-serif&amp;quot;"&gt;&amp;#160;&lt;/span&gt;&lt;/div&gt;
  &lt;table class="MsoNormalTable" border="1" cellspacing="0" cellpadding="0" style="border-top: black 1pt solid; border-right: black 1pt solid; background: white; border-bottom: black 1pt solid; border-left: black 1pt solid"&gt;&lt;tbody&gt;&lt;tr&gt;&lt;td style="border-top: gray 1pt solid; border-right: gray 1pt solid; background: #ededed; border-bottom: gray 1pt solid; padding-bottom: 0.75pt; padding-top: 0.75pt; padding-left: 1.5pt; border-left: gray 1pt solid; padding-right: 1.5pt"&gt;&lt;div&gt;&lt;b&gt;&lt;span style="font-size: 8.5pt; font-family: &amp;quot;verdana&amp;quot;, &amp;quot;sans-serif&amp;quot;; color: black"&gt;#&lt;/span&gt;&lt;/b&gt;&lt;/div&gt;&lt;/td&gt;
  &lt;td style="border-top: gray 1pt solid; border-right: gray 1pt solid; background: #ededed; border-bottom: gray 1pt solid; padding-bottom: 0.75pt; padding-top: 0.75pt; padding-left: 1.5pt; border-left: gray 1pt solid; padding-right: 1.5pt"&gt;&lt;div&gt;&lt;b&gt;&lt;span style="font-size: 8.5pt; font-family: &amp;quot;verdana&amp;quot;, &amp;quot;sans-serif&amp;quot;; color: black"&gt;PR&lt;/span&gt;&lt;/b&gt;&lt;/div&gt;&lt;/td&gt;
  &lt;td style="border-top: gray 1pt solid; border-right: gray 1pt solid; background: #ededed; border-bottom: gray 1pt solid; padding-bottom: 0.75pt; padding-top: 0.75pt; padding-left: 1.5pt; border-left: gray 1pt solid; padding-right: 1.5pt"&gt;&lt;div&gt;&lt;b&gt;&lt;span style="font-size: 8.5pt; font-family: &amp;quot;verdana&amp;quot;, &amp;quot;sans-serif&amp;quot;; color: black"&gt;DATUM PREGLEDA&lt;/span&gt;&lt;/b&gt;&lt;/div&gt;&lt;/td&gt;
  &lt;td style="border-top: gray 1pt solid; border-right: gray 1pt solid; background: #ededed; border-bottom: gray 1pt solid; padding-bottom: 0.75pt; padding-top: 0.75pt; padding-left: 1.5pt; border-left: gray 1pt solid; padding-right: 1.5pt"&gt;&lt;div&gt;&lt;b&gt;&lt;span style="font-size: 8.5pt; font-family: &amp;quot;verdana&amp;quot;, &amp;quot;sans-serif&amp;quot;; color: black"&gt;VIN&lt;/span&gt;&lt;/b&gt;&lt;/div&gt;&lt;/td&gt;
  &lt;td style="border-top: gray 1pt solid; border-right: gray 1pt solid; background: #ededed; border-bottom: gray 1pt solid; padding-bottom: 0.75pt; padding-top: 0.75pt; padding-left: 1.5pt; border-left: gray 1pt solid; padding-right: 1.5pt"&gt;&lt;div&gt;&lt;b&gt;&lt;span style="font-size: 8.5pt; font-family: &amp;quot;verdana&amp;quot;, &amp;quot;sans-serif&amp;quot;; color: black"&gt;DEL&lt;/span&gt;&lt;/b&gt;&lt;/div&gt;&lt;/td&gt;
  &lt;td style="border-top: gray 1pt solid; border-right: gray 1pt solid; background: #ededed; border-bottom: gray 1pt solid; padding-bottom: 0.75pt; padding-top: 0.75pt; padding-left: 1.5pt; border-left: gray 1pt solid; padding-right: 1.5pt"&gt;&lt;div&gt;&lt;b&gt;&lt;span style="font-size: 8.5pt; font-family: &amp;quot;verdana&amp;quot;, &amp;quot;sans-serif&amp;quot;; color: black"&gt;OPIS DELA&lt;/span&gt;&lt;/b&gt;&lt;/div&gt;&lt;/td&gt;
  &lt;td style="border-top: gray 1pt solid; border-right: gray 1pt solid; background: #ededed; border-bottom: gray 1pt solid; padding-bottom: 0.75pt; padding-top: 0.75pt; padding-left: 1.5pt; border-left: gray 1pt solid; padding-right: 1.5pt"&gt;&lt;div&gt;&lt;b&gt;&lt;span style="font-size: 8.5pt; font-family: &amp;quot;verdana&amp;quot;, &amp;quot;sans-serif&amp;quot;; color: black"&gt;POŠK&lt;/span&gt;&lt;/b&gt;&lt;/div&gt;&lt;/td&gt;
  &lt;td style="border-top: gray 1pt solid; border-right: gray 1pt solid; background: #ededed; border-bottom: gray 1pt solid; padding-bottom: 0.75pt; padding-top: 0.75pt; padding-left: 1.5pt; border-left: gray 1pt solid; padding-right: 1.5pt"&gt;&lt;div&gt;&lt;b&gt;&lt;span style="font-size: 8.5pt; font-family: &amp;quot;verdana&amp;quot;, &amp;quot;sans-serif&amp;quot;; color: black"&gt;OPIS POŠKODBE&lt;/span&gt;&lt;/b&gt;&lt;/div&gt;&lt;/td&gt;
  &lt;td style="border-top: gray 1pt solid; border-right: gray 1pt solid; background: #ededed; border-bottom: gray 1pt solid; padding-bottom: 0.75pt; padding-top: 0.75pt; padding-left: 1.5pt; border-left: gray 1pt solid; padding-right: 1.5pt"&gt;&lt;div&gt;&lt;b&gt;&lt;span style="font-size: 8.5pt; font-family: &amp;quot;verdana&amp;quot;, &amp;quot;sans-serif&amp;quot;; color: black"&gt;DIMENZIJE / OPOMBE&lt;/span&gt;&lt;/b&gt;&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
  &lt;tr&gt;&lt;td style="border-top: gray 1pt solid; border-right: gray 1pt solid; background: #ededed; border-bottom: gray 1pt solid; padding-bottom: 0.75pt; padding-top: 0.75pt; padding-left: 1.5pt; border-left: gray 1pt solid; padding-right: 1.5pt"&gt;&lt;div&gt;&lt;span style="font-size: 8.5pt; font-family: &amp;quot;verdana&amp;quot;, &amp;quot;sans-serif&amp;quot;; color: black"&gt;1&lt;/span&gt;&lt;/div&gt;&lt;/td&gt;
  &lt;td style="border-top: #cccccc 1pt solid; border-right: #cccccc 1pt solid; border-bottom: #cccccc 1pt solid; padding-bottom: 0cm; padding-top: 0cm; padding-left: 1.5pt; border-left: #cccccc 1pt solid; padding-right: 1.5pt; background-color: transparent"&gt;&lt;div&gt;&lt;span style="font-size: 8.5pt; font-family: &amp;quot;verdana&amp;quot;, &amp;quot;sans-serif&amp;quot;; color: #303030"&gt;ZP&lt;/span&gt;&lt;/div&gt;&lt;/td&gt;
  &lt;td style="border-top: #cccccc 1pt solid; border-right: #cccccc 1pt solid; border-bottom: #cccccc 1pt solid; padding-bottom: 0cm; padding-top: 0cm; padding-left: 1.5pt; border-left: #cccccc 1pt solid; padding-right: 1.5pt; background-color: transparent"&gt;&lt;div&gt;&lt;span style="font-size: 8.5pt; font-family: &amp;quot;verdana&amp;quot;, &amp;quot;sans-serif&amp;quot;; color: #303030"&gt;2017-02-19&amp;#160;11:56:52.0&lt;/span&gt;&lt;/div&gt;&lt;/td&gt;
  &lt;td style="border-top: #cccccc 1pt solid; border-right: #cccccc 1pt solid; border-bottom: #cccccc 1pt solid; padding-bottom: 0cm; padding-top: 0cm; padding-left: 1.5pt; border-left: #cccccc 1pt solid; padding-right: 1.5pt; background-color: transparent"&gt;&lt;div&gt;&lt;span style="font-size: 8.5pt; font-family: &amp;quot;verdana&amp;quot;, &amp;quot;sans-serif&amp;quot;; color: #303030"&gt;VSSZZZ5FZH6536022&lt;/span&gt;&lt;/div&gt;&lt;/td&gt;
  &lt;td style="border-top: #cccccc 1pt solid; border-right: #cccccc 1pt solid; border-bottom: #cccccc 1pt solid; padding-bottom: 0cm; padding-top: 0cm; padding-left: 1.5pt; border-left: #cccccc 1pt solid; padding-right: 1.5pt; background-color: transparent"&gt;&lt;div&gt;&lt;span style="font-size: 8.5pt; font-family: &amp;quot;verdana&amp;quot;, &amp;quot;sans-serif&amp;quot;; color: #303030"&gt;43&lt;/span&gt;&lt;/div&gt;&lt;/td&gt;
  &lt;td style="border-top: #cccccc 1pt solid; border-right: #cccccc 1pt solid; border-bottom: #cccccc 1pt solid; padding-bottom: 0cm; padding-top: 0cm; padding-left: 1.5pt; border-left: #cccccc 1pt solid; padding-right: 1.5pt; background-color: transparent"&gt;&lt;div&gt;&lt;span style="font-size: 8.5pt; font-family: &amp;quot;verdana&amp;quot;, &amp;quot;sans-serif&amp;quot;; color: #303030"&gt;zadnji&amp;#160;odbijač&lt;/span&gt;&lt;/div&gt;&lt;/td&gt;
  &lt;td style="border-top: #cccccc 1pt solid; border-right: #cccccc 1pt solid; border-bottom: #cccccc 1pt solid; padding-bottom: 0cm; padding-top: 0cm; padding-left: 1.5pt; border-left: #cccccc 1pt solid; padding-right: 1.5pt; background-color: transparent"&gt;&lt;div&gt;&lt;span style="font-size: 8.5pt; font-family: &amp;quot;verdana&amp;quot;, &amp;quot;sans-serif&amp;quot;; color: #303030"&gt;12&lt;/span&gt;&lt;/div&gt;&lt;/td&gt;
  &lt;td style="border-top: #cccccc 1pt solid; border-right: #cccccc 1pt solid; border-bottom: #cccccc 1pt solid; padding-bottom: 0cm; padding-top: 0cm; padding-left: 1.5pt; border-left: #cccccc 1pt solid; padding-right: 1.5pt; background-color: transparent"&gt;&lt;div&gt;&lt;span style="font-size: 8.5pt; font-family: &amp;quot;verdana&amp;quot;, &amp;quot;sans-serif&amp;quot;; color: #303030"&gt;PODRSANO&lt;/span&gt;&lt;/div&gt;&lt;/td&gt;
  &lt;td style="border-top: #cccccc 1pt solid; border-right: #cccccc 1pt solid; border-bottom: #cccccc 1pt solid; padding-bottom: 0cm; padding-top: 0cm; padding-left: 1.5pt; border-left: #cccccc 1pt solid; padding-right: 1.5pt; background-color: transparent"&gt;&lt;div&gt;&lt;span style="font-size: 8.5pt; font-family: &amp;quot;verdana&amp;quot;, &amp;quot;sans-serif&amp;quot;; color: #303030"&gt;100X10&amp;#160;20X2&amp;#160;10X2&amp;#160;50X2&lt;/span&gt;&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
  &lt;tr&gt;&lt;td style="border-top: gray 1pt solid; border-right: gray 1pt solid; background: #ededed; border-bottom: gray 1pt solid; padding-bottom: 0.75pt; padding-top: 0.75pt; padding-left: 1.5pt; border-left: gray 1pt solid; padding-right: 1.5pt"&gt;&lt;div&gt;&lt;span style="font-size: 8.5pt; font-family: &amp;quot;verdana&amp;quot;, &amp;quot;sans-serif&amp;quot;; color: black"&gt;2&lt;/span&gt;&lt;/div&gt;&lt;/td&gt;
  &lt;td style="border-top: #cccccc 1pt solid; border-right: #cccccc 1pt solid; border-bottom: #cccccc 1pt solid; padding-bottom: 0cm; padding-top: 0cm; padding-left: 1.5pt; border-left: #cccccc 1pt solid; padding-right: 1.5pt; background-color: transparent"&gt;&lt;div&gt;&lt;span style="font-size: 8.5pt; font-family: &amp;quot;verdana&amp;quot;, &amp;quot;sans-serif&amp;quot;; color: #303030"&gt;ZP&lt;/span&gt;&lt;/div&gt;&lt;/td&gt;
  &lt;td style="border-top: #cccccc 1pt solid; border-right: #cccccc 1pt solid; border-bottom: #cccccc 1pt solid; padding-bottom: 0cm; padding-top: 0cm; padding-left: 1.5pt; border-left: #cccccc 1pt solid; padding-right: 1.5pt; background-color: transparent"&gt;&lt;div&gt;&lt;span style="font-size: 8.5pt; font-family: &amp;quot;verdana&amp;quot;, &amp;quot;sans-serif&amp;quot;; color: #303030"&gt;2017-02-19&amp;#160;11:57:38.0&lt;/span&gt;&lt;/div&gt;&lt;/td&gt;
  &lt;td style="border-top: #cccccc 1pt solid; border-right: #cccccc 1pt solid; border-bottom: #cccccc 1pt solid; padding-bottom: 0cm; padding-top: 0cm; padding-left: 1.5pt; border-left: #cccccc 1pt solid; padding-right: 1.5pt; background-color: transparent"&gt;&lt;div&gt;&lt;span style="font-size: 8.5pt; font-family: &amp;quot;verdana&amp;quot;, &amp;quot;sans-serif&amp;quot;; color: #303030"&gt;VSSZZZ5FZH6545134&lt;/span&gt;&lt;/div&gt;&lt;/td&gt;
  &lt;td style="border-top: #cccccc 1pt solid; border-right: #cccccc 1pt solid; border-bottom: #cccccc 1pt solid; padding-bottom: 0cm; padding-top: 0cm; padding-left: 1.5pt; border-left: #cccccc 1pt solid; padding-right: 1.5pt; background-color: transparent"&gt;&lt;div&gt;&lt;span style="font-size: 8.5pt; font-family: &amp;quot;verdana&amp;quot;, &amp;quot;sans-serif&amp;quot;; color: #303030"&gt;43&lt;/span&gt;&lt;/div&gt;&lt;/td&gt;
  &lt;td style="border-top: #cccccc 1pt solid; border-right: #cccccc 1pt solid; border-bottom: #cccccc 1pt solid; padding-bottom: 0cm; padding-top: 0cm; padding-left: 1.5pt; border-left: #cccccc 1pt solid; padding-right: 1.5pt; background-color: transparent"&gt;&lt;div&gt;&lt;span style="font-size: 8.5pt; font-family: &amp;quot;verdana&amp;quot;, &amp;quot;sans-serif&amp;quot;; color: #303030"&gt;zadnji&amp;#160;odbijač&lt;/span&gt;&lt;/div&gt;&lt;/td&gt;
  &lt;td style="border-top: #cccccc 1pt solid; border-right: #cccccc 1pt solid; border-bottom: #cccccc 1pt solid; padding-bottom: 0cm; padding-top: 0cm; padding-left: 1.5pt; border-left: #cccccc 1pt solid; padding-right: 1.5pt; background-color: transparent"&gt;&lt;div&gt;&lt;span style="font-size: 8.5pt; font-family: &amp;quot;verdana&amp;quot;, &amp;quot;sans-serif&amp;quot;; color: #303030"&gt;12&lt;/span&gt;&lt;/div&gt;&lt;/td&gt;
  &lt;td style="border-top: #cccccc 1pt solid; border-right: #cccccc 1pt solid; border-bottom: #cccccc 1pt solid; padding-bottom: 0cm; padding-top: 0cm; padding-left: 1.5pt; border-left: #cccccc 1pt solid; padding-right: 1.5pt; background-color: transparent"&gt;&lt;div&gt;&lt;span style="font-size: 8.5pt; font-family: &amp;quot;verdana&amp;quot;, &amp;quot;sans-serif&amp;quot;; color: #303030"&gt;PODRSANO&lt;/span&gt;&lt;/div&gt;&lt;/td&gt;
  &lt;td style="border-top: #cccccc 1pt solid; border-right: #cccccc 1pt solid; border-bottom: #cccccc 1pt solid; padding-bottom: 0cm; padding-top: 0cm; padding-left: 1.5pt; border-left: #cccccc 1pt solid; padding-right: 1.5pt; background-color: transparent"&gt;&lt;div&gt;&lt;span style="font-size: 8.5pt; font-family: &amp;quot;verdana&amp;quot;, &amp;quot;sans-serif&amp;quot;; color: #303030"&gt;800X50&lt;/span&gt;&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;&lt;/tbody&gt;&lt;/table&gt;
  &lt;p&gt;&amp;#160;&lt;/p&gt;</code></pre>
  </div>
  </div>
  </p>
  
  <p>Encoding set to UTF-8.</p>
  
  <pre><code>//ParseToElementList overided method (UTF-8)
  public static ElementList ParseToElementList(String html, String css)
  {
      // CSS
      ICSSResolver cssResolver = new StyleAttrCSSResolver();
      if (css != null)
      {
          ICssFile cssFile = XMLWorkerHelper.GetCSS(new MemoryStream(Encoding.UTF8.GetBytes(css)));
          cssResolver.AddCss(cssFile);
      }
  
      // HTML
      CssAppliers cssAppliers = new CssAppliersImpl(FontFactory.FontImp);
      HtmlPipelineContext htmlContext = new HtmlPipelineContext(cssAppliers);
      htmlContext.SetTagFactory(Tags.GetHtmlTagProcessorFactory());
      htmlContext.AutoBookmark(false);
  
      // Pipelines
      ElementList elements = new ElementList();
      ElementHandlerPipeline end = new ElementHandlerPipeline(elements, null);
      HtmlPipeline htmlPipeline = new HtmlPipeline(htmlContext, end);
      CssResolverPipeline cssPipeline = new CssResolverPipeline(cssResolver, htmlPipeline);
  
      // XML Worker
      XMLWorker worker = new XMLWorker(cssPipeline, true);
      XMLParser p = new XMLParser(worker);
      p.Parse(new MemoryStream(Encoding.UTF8.GetBytes(html)));
  
      return elements;
  }
  </code></pre>
  
  <p>Filling parsed HTML into PdfCell</p>
  
  <pre><code>List&lt;IElement&gt; elementsIzv = ParseToElementList(nonConformity[Helper_ND_Display.porociloIzvedba].ToString(), null);
  foreach (IElement e in elementsIzv)
  {
      porociloData.AddElement(e);
  }
  resitevTable.AddCell(porociloData);
  </code></pre>
  
  <p>All working fine except character č(Č) (&amp;#269) is not converted(missing). I'm i missing something or is there a bug in ParseToElementList method? Converting HTML with method GetInstance</p>
  
  <pre><code>XMLWorkerHelper.GetInstance().ParseXHtml(writer, document, reader);
  </code></pre>
  
  <p>is converting all characters as required. </p>