Search code examples
ruby-on-railsruby-on-rails-3utf-8wkhtmltopdfpdfkit

How to use UTF-8 in PDFKit in Rails?


I'm using PDFKit in my Rails app to generate PDF's. Problem is some of my content in contains non-ascii characters. How do I force it to use UTF-8?


Solution

  • Fixed by adding this to in the html head:

    <meta http-equiv="Content-type" content="text/html; charset=utf-8" />