The code:
format.pdf do
pdf = Prawn::Document.new
pdf.text "Hello World"
pdf.text "ƒ ≥ → ∏".force_encoding("Windows-1252")
pdf.render_file "public/#{filename}"
send_data pdf.render, filename: filename, type: 'application/pdf', disposition: "inline"
The result:
Hello World
ƒ ≥ → ∕
Without .force_encoding("Windows-1252"), send:
Your document includes text that's not compatible with the Windows-1252 character set. If you need full UTF-8 support, use TTF fonts instead of PDF's built-in fonts.