Lighthouse has a new layout. Prefer the old one? Return to the old layout, and switch back any time from the link at the top of each page.

This project is archived and is in readonly mode.

Fix for send_data Content-Length header in Ruby 1.9

#2661

In Ruby 1.9 String#size returns the actual character length, not size in bytes. send_data sets Content-Length header to length in characters so when sending multi-byte encoded text the file gets truncated. Example:

send_data("Кирилица", :type => text, :filename => 'utf8_text') # => the browser receives "Кири"

Here is a patch to fix this.

Reported by Sava Chankov · May 17th, 2009 @ 05:27 PM

State: resolved
Milestone: 2.3.4
Assigned to: Jeremy Kemper Jeremy Kemper
Importance: none