Defect #10575

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

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

Status:ClosedStart date:
Priority:NormalDue date:
Assignee:-% Done:

0%

Category:Ruby support
Target version:1.4.0
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 support Closed 2009-10-18

Associated revisions

Revision 9334
Added by Jean-Philippe Lang over 5 years ago

Uploading of attachments which filename contains non-ASCII chars fails with Ruby 1.9 on issue update (#10575).

History

#1 Updated by Etienne Massip over 5 years ago

Seems to be ok with ruby 1.9.3p0 on webrick??

#2 Updated by Jun NAITOH over 5 years ago

I reproduced with a simple é.txt file on trunk.

  1. Create New Issue.
  2. Update Issue with é.txt file attachment.
  • CentOS 6.0(x86)
  • Ruby 1.9.2-p290 and Ruby 1.9.3-p125
  • passenger (3.0.8)
  • Apache 2.2.15

Encoding configuration is: "" (no setting)

I think this is Issue's "Update" only problem.

#3 Updated by Ivan Cenov over 5 years ago

I did not reproduce with Ruby 1.8.7.

#4 Updated by Jean-Philippe Lang over 5 years ago

  • Status changed from New to Closed
  • Resolution set to Fixed

I was able to reproduce with webrick + ruby 1.9.3 when updating an issue.
It's fixed in r9334.

Also available in: Atom PDF