Hi,
Why did you allow this incompatibility? ;)
* fixtures/notifications/signup:
_foo
@expected.body = read_fixture(''signup'')
p @expected.body
#=> " foo\n"
# because text.gsub(/_/," ")
If you enhance TMail::Mail#body like this,
I want you to convert mail.body code in render_body.
My mailer code now:
# topic is a ActiveRecord instance. topic attrs encoding is Shift_JIS.
mail = Notifications.create_invoice(sent_on, {"topic"=>topic})
# convert from Shift_JIS to ISO-2022-JP
# mail.body is incompatible between 1.7.1 and 1.8.0 in ActionMailer...
mail.body = NKF.nkf(''-Sj -m0'', mail.quoted_body) # sigh.
Notifications.deliver(mail)
class Notifications < ActionMailer::Base
@@default_charset = "iso-2022-jp"
@@encode_subject = false
# and set Ruby option -Ks (Kcode is SJIS).
# uses Base64 encoding (default in TMail).
def invoice(sent_on = Time.now, options = {})
@subject = "in Japanese ..."
@body = options
@recipients =
''rcpt-hcDgGtZH8xNBDgjK7y7TUQ@public.gmane.org''
@from =
''from-hcDgGtZH8xNBDgjK7y7TUQ@public.gmane.org''
@sent_on = sent_on
@headers = {}
end
end
* views/notifications/invoice.rhtml:
<%= @topic.content %>
Thanks,
----
Kazuhiro Yoshida moriq-g2rar0VqK2oAvxtiuMwx3w@public.gmane.org