title: send PDF with rails send_data
body: <p>I use ruby 1.9.3 and redmine 1.4.4</p>
  
  <p>According to this -> <a href="https://stackoverflow.com/questions/1698386/please-help-me-send-a-jpg-file-using-send-data">Please help me send a jpg file using send_data</a> , I do that in a controller:</p>
  
  <pre><code>  @file = temp.path
    File.open(@file, 'r') do |f|
      send_data f.read, :filename =&gt; "myfile.pdf", :type =&gt; "application/pdf", :disposition =&gt; "attachment"
    end
    File.delete(@file)
  </code></pre>
  
  <p>But it returns <code>ArgumentError (invalid byte sequence in UTF-8)</code>, why ?</p>