On 3/7/07, Isak Hansen
<isak.hansen-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org>
wrote:> 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
>
Did some debugging on this issue, and found that my strings are
getting mutilated by sprintf, which fpdf is using for string
substitution, i.e. this is a kcode/ruby issue, and has nothing to do
with rails.
Taking the discussion to comp.lang.ruby instead, thanks.
Isak
--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups
"Ruby on Rails: Talk" group.
To post to this group, send email to
rubyonrails-talk-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org
To unsubscribe from this group, send email to
rubyonrails-talk-unsubscribe-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org
For more options, visit this group at
http://groups.google.com/group/rubyonrails-talk?hl=en
-~----------~----~----~----~------~----~------~--~---