'Wicked_pdf and utf8 symbol
In my generated pdf I get this
0,00 €
instead of
0,00 €
Application.html.erb
<meta charset="utf-8">
<meta http-equiv="content-type" content="text/html; charset=utf-8" />
show.html.erb
<%=number_to_currency item.total%>
Solution 1:[1]
respond_to do |format|
format.html { render template: 'invoices/show' }
format.pdf do
render pdf: 'invoices/show',
template: 'invoices/show',
formats: :HTML,
encoding: 'utf8'
end
end
Solution 2:[2]
Still i can see the special characters in the PDF. Below is my code
pdf = WickedPdf.new.pdf_from_string(page_html,:page_size => "A3")
send_data(pdf,
:filename => "my_pdf_name.pdf",
:formats => 'HTML',
:encoding => 'utf8',
:disposition => 'attachment')
end
Sources
This article follows the attribution requirements of Stack Overflow and is licensed under CC BY-SA 3.0.
Source: Stack Overflow
Solution | Source |
---|---|
Solution 1 | Grzegorz |
Solution 2 | Lokesh S |