DEV Community

radin reth
radin reth

Posted on

wicked pdf does not render UTF-8

Unicode characters does not render properly when generate pdf using wicked pdf. There are 3 steps need to follow:

  1. Set encoding: 'utf8'
render pdf: "myfile",
       ....,
       encoding: 'utf8',
       ...
Enter fullscreen mode Exit fullscreen mode
  1. Make sure to render proper meta tag in layout template
%meta{:content => "text/html; charset=utf-8", "http-equiv" => "content-type"}
%meta{:charset => "utf-8"}
Enter fullscreen mode Exit fullscreen mode
  1. Install system fonts
apt-get install fonts-khmeros
Enter fullscreen mode Exit fullscreen mode

Top comments (0)