Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

rails, wicked-pdf gem and é à ö characters showing incorrectly

When I generate a PDF with text containing characters such as é è à and so on I do get funny characters instead.

I know this must be related to encoding.

I did try force_encoding("UTF-8") on the string with those characters with no success.

joel

like image 549
zabumba Avatar asked Feb 05 '12 23:02

zabumba


2 Answers

Add <meta charset="UTF-8"> to the top of your HTML view or in the head of your layout.

like image 88
Unixmonkey Avatar answered Sep 29 '22 13:09

Unixmonkey


You can pass as option:

encoding: 'utf8'
like image 25
ajahongir Avatar answered Sep 29 '22 12:09

ajahongir