title: How to enable UTF-8 in jsPDF library
body: <p>I am very happy to use jsPDF library which helps me to export my HTML page as PDF file. I came across some difficulties. I downloaded the library from <a href="http://parall.ax/products/jspdf/">http://parall.ax/products/jspdf/</a>. When I use some characters like š, ć (UTF-8), in pdf they look like error. Even if I insert via doc.text. On the library's website, when I use their examples and change text using some of these characters - it works. So it is suppose to work with UTF-8. Why it isn't working on my computer.</p>
  
  <p>I provide you my code. All missing here is the lib (which can be downloaded from the website) and you will see my problem. And why the CSS is dissapeared in pdf?</p>
  
  <p><strong>testing.html</strong></p>
  
  <pre><code>&lt;html&gt;
  &lt;head&gt;
  &lt;meta http-equiv="Content-Type" content="text/html; charset=utf-8" /&gt;
  &lt;title&gt;TESTING JSPDF LIB&lt;/title&gt;
  &lt;script type="text/javascript" src="pdffile.js" charset="utf-8"&gt;&lt;/script&gt;
  &lt;script type="text/javascript" src="jspdf/jquery/jquery-1.11.0.min.js"&gt;&lt;/script&gt;
  &lt;script type="text/javascript" src="jspdf/jspdf.js"&gt;&lt;/script&gt;
  &lt;script type="text/javascript" src="jspdf/libs/Deflate/adler32cs.js"&gt;&lt;/script&gt;
  &lt;script type="text/javascript" src="jspdf/libs/FileSaver.js/FileSaver.js"&gt;&lt;/script&gt;
  &lt;script type="text/javascript" src="jspdf/libs/Blob.js/BlobBuilder.js"&gt;&lt;/script&gt;
  &lt;script type="text/javascript" src="jspdf/jspdf.plugin.addimage.js"&gt;&lt;/script&gt;
  &lt;script type="text/javascript" src="jspdf/jspdf.plugin.standard_fonts_metrics.js"&gt;&lt;/script&gt;
  &lt;script type="text/javascript" src="jspdf/jspdf.plugin.split_text_to_size.js"&gt;&lt;/script&gt;
  &lt;script type="text/javascript" src="jspdf/jspdf.plugin.from_html.js"&gt;&lt;/script&gt;
  &lt;script&gt;
  function redirect() {
      document.write("Hello world" + '&lt;br /&gt;');
  }
  &lt;/script&gt;
  &lt;/head&gt;
  
  &lt;body&gt;
  &lt;div id="box" class="box-shadow"&gt;
      &lt;input type="submit" name="ok" id="ok" value="LETS TRY" onClick="redirect();pdf();" /&gt; &lt;/div&gt;
  &lt;/div&gt;
  &lt;/body&gt;
  &lt;/html&gt;
  </code></pre>
  
  <p><strong>pdffile.js</strong></p>
  
  <pre><code>function pdf() {
  document.write('&lt;div id="mydiv" style="background-color:#CCC; width:780px;640px;"&gt;&lt;p&gt;Open these letters š and c in PDF file and see error&lt;/p&gt;&lt;/div&gt;&lt;br /&gt;');
  document.write('&lt;button id="export"&gt;OPEN IN PDF FILE&lt;/button&gt;');
  
  $(function () {
      var doc = new jsPDF();
      doc.text(35, 25, "Text with the letter Š");
      var specialElementHandlers = {
          'body': function (element, renderer) { 
              return true;
          }
      };
      $('#export').click(function () {
          doc.fromHTML($('#mydiv').html(), 15, 15, {
              'width': 170,
                  'elementHandlers': specialElementHandlers
          });
          doc.save('sample-file.pdf');
      });
  });
  }
  </code></pre>