This code seems to break under rails and the console (1.2.2 branch),
while working as expected under irb:
require “fpdf/fpdf”
s = ("" << 73 << 241 << 116 << 234 << 114 << 110 << 228 << 116 << 105
<< 111 << 110 << 97 << 108 << 105 << 122 << 230 << 116 << 105 << 248
<< 110)
pdf = FPDF.new
pdf.AddPage
pdf.SetFont(“Arial”, “B”, 16)
pdf.Cell(40, 10, s)
pdf.Output(“test.pdf”)
The string should be valid cp1252, which afaik is also the default
encoding for fpdf.
Running this code from irb creates a pdf containing the whole string,
while trying to write the same string from within Rails or running
this code in script/console chops off the last two characters…?
Any suggestions appreciated.
Isak