Project

General

Profile

Actions

Defect #10051

closed

Ruby 1.9.2 and mailer encoding

Added by Ilya Azarov about 12 years ago. Updated about 12 years ago.

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

0%

Estimated time:
Resolution:
Duplicate
Affected version:

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

Is duplicate of Redmine - Feature #4050: Ruby 1.9 supportClosed2009-10-18

Actions
Actions #1

Updated by Jean-Philippe Lang about 12 years ago

  • Description updated (diff)
Actions #2

Updated by Ilya Azarov about 12 years ago

This bug exists when saving e-mails in html format.

Actions #3

Updated by Toshi MARUYAMA about 12 years ago

  • Status changed from New to Closed
  • Resolution set to Duplicate
Actions

Also available in: Atom PDF