Defect #10051
Ruby 1.9.2 and mailer encoding
| Status: | Closed | Start date: | ||
|---|---|---|---|---|
| Priority: | Normal | Due date: | ||
| Assignee: | - | % Done: | 0% |
|
| Category: | Ruby interpreter support | |||
| Target version: | - | |||
| Affected version: | 1.3.0 | Resolution: | Duplicate |
Description
We've got following while sending UTF-8 mails.
ActionView::TemplateError (incompatible character encodings: UTF-8 and ASCII-8BIT) on line #7 of app/views/mailer/issue_edit.text.erb:
4: <%= show_detail(detail, true) %>
5: <% end -%>
6:
7: <%= @journal.notes if @journal.notes? %>
8: ----------------------------------------
9: <%= render :partial => "issue.text.erb", :locals => { :issue => @issue, :issue_url => @issue_url } %>
app/views/mailer/issue_edit.text.erb:7:in `concat'
app/views/mailer/issue_edit.text.erb:7
app/models/mailer.rb:431:in `render_multipart'
app/models/mailer.rb:80:in `issue_edit'
app/models/journal_observer.rb:27:in `after_create'
/usr/lib/ruby/1.9.1/observer.rb:186:in `block in notify_observers'
/usr/lib/ruby/1.9.1/observer.rb:185:in `each'
/usr/lib/ruby/1.9.1/observer.rb:185:in `notify_observers'
app/models/journal.rb:48:in `save'
app/models/issue.rb:928:in `create_journal'
app/models/issue.rb:630:in `block in save_issue_with_child_records'
app/models/issue.rb:614:in `save_issue_with_child_records'
app/controllers/issues_controller.rb:181:in `update'
<internal:prelude>:10:in `synchronize'
thin (1.3.1) lib/thin/stats.rb:24:in `block in call'
thin (1.3.1) lib/thin/stats.rb:33:in `log'
thin (1.3.1) lib/thin/stats.rb:24:in `call'
thin (1.3.1) lib/thin/connection.rb:80:in `block in pre_process'
thin (1.3.1) lib/thin/connection.rb:78:in `catch'
thin (1.3.1) lib/thin/connection.rb:78:in `pre_process'
thin (1.3.1) lib/thin/connection.rb:53:in `process'
thin (1.3.1) lib/thin/connection.rb:38:in `receive_data'
eventmachine (0.12.10) lib/eventmachine.rb:256:in `run_machine'
eventmachine (0.12.10) lib/eventmachine.rb:256:in `run'
As solution for now I've added force_encoding to template variable.
But there is something wrong with string encodings inside app/models/mailer.rb
Related issues
History
#1 Updated by Jean-Philippe Lang 4 months ago
- Description updated (diff)
#2 Updated by Ilya Azarov 4 months ago
This bug exists when saving e-mails in html format.
#3 Updated by Toshi MARUYAMA 4 months ago
- Status changed from New to Closed
- Resolution set to Duplicate
Try http://www.redmine.org/issues/4050#note-16 patch.