Defect #10051
Updated by Jean-Philippe Lang almost 13 years ago
We've got following while sending UTF-8 mails. <pre> 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' </pre> 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