Project

General

Profile

Actions

Defect #10575

closed

Uploading of attachments which filename contains non-ASCII chars fails with Ruby 1.9

Added by Etienne Massip over 12 years ago. Updated over 12 years ago.

Status:
Closed
Priority:
Normal
Assignee:
-
Category:
Ruby support
Target version:
Start date:
Due date:
% Done:

0%

Estimated time:
Resolution:
Fixed
Affected version:

Description

Hi,

Not sure why but I have an Internal error when uploading a document which filename contains a "é" to an issue I'm watching.

It can be reproduced with a simple é.txt file.

Running 1.9p125 and mongrel with no patch as script/server.

Log is as follow:

Processing IssuesController#update (for 10.132.21.139 at 2012-03-30 09:21:24) [PUT]
 Parameters: {"_method"=>"put", "authenticity_token"=>"X3zSAzHsi/w6jcN6XPtTUO6dSRyEYZ0h04nB1weQICk=", "issue"=>{"is_private"=>"0", "project_id"=>"26", "tracker_id"=>"1", "subject"=>"Test", "description"=>"", "status_id"=>"1", "priority_id"=>"4", "assigned_to_id"=>"", "category_id"=>"", "fixed_version_id"=>"", "parent_issue_id"=>"", "start_date"=>"", "due_date"=>"", "estimated_hours"=>"", "done_ratio"=>"0", "custom_field_values"=>{"6"=>""}, "lock_version"=>"2"}, "time_entry"=>{"hours"=>"", "activity_id"=>"", "comments"=>""}, "notes"=>"", "attachments"=>{"1"=>{"file"=>#<File:C:/DOCUME~1/A19E12~1/LOCALS~1/Temp/1/RackMultipart20120330-8168-1plxsd>, "description"=>""}}, "last_journal_id"=>"1764", "commit"=>"Soumettre", "controller"=>"issues", "action"=>"update", "id"=>"804"}
Saving attachment 'D:/redmine/files/120330092124_814a32383afcebc0007413871a7a145e.txt' (3 bytes)

ActionView::TemplateError (incompatible character encodings: UTF-8 and ASCII-8BIT) on line #4 of app/views/mailer/issue_edit.text.erb:
1: <%= l(:text_issue_updated, :id => "##{@issue.id <http://issue.id>}", :author => @journal.user) %>

2:
3: <% details_to_strings(@journal.details, true).each do |string| -%>
4: <%= string %>
5: <% end -%>
6:
7: <%= @journal.notes if @journal.notes? %>

   app/views/mailer/issue_edit.text.erb:4:in `concat'
   app/views/mailer/issue_edit.text.erb:4:in `block in _run_erb_app47views47mailer47issue_edit46text46erb'
   app/views/mailer/issue_edit.text.erb:3:in `each'
   app/views/mailer/issue_edit.text.erb:3
   app/models/mailer.rb:442:in `render_multipart'
   app/models/mailer.rb:78:in `issue_edit'
   app/models/journal_observer.rb:26:in `after_create'
   C:/Ruby193/lib/ruby/1.9.1/observer.rb:195:in `block in notify_observers'
etc.

Encoding configuration is: UTF-8, ISO 8859-15, CP1252

References to potentially related issues reported by Toshi:

Related issues

Related to Redmine - Feature #4050: Ruby 1.9 supportClosed2009-10-18

Actions
Actions

Also available in: Atom PDF