ruby-on-railsruby-on-rails-3pdf-generationprawnprawnto

How to output special characters in Prawn?


I am trying to output currency symbols in Prawn with a helper method like this:

def price(number)
  @view.number_to_currency(number, :unit => "€")
end

I then use it like this:

price(@invoice.total)

Unfortunately it's not working and instead of I get € in my PDF documents.

(The same number_to_currency function works great outside of Prawn by the way.)

Can anybody help?


Solution

  • OK, I solved it by just using special characters like instead of HTML-entities like €. I had to tweak my app a bit to achieve that, though.