ActionMailer and TMail need multilocalization in Ruby 1.9 so
that a Rails application send a mail with a correct encoding.
Status
Japanese texts
ActionMailer always sends an email in UTF-8. According to RFC
1468, however, Japanese email should be encoded in ISO-2022-JP. The
RFC is just a guide, not a standard. But most of MUA prefer
ISO-2022-JP to UTF-8 for Japanese. Japanese mobile phones can
send/receive internet emails but most of them accept only
ISO-2022-JP.
So TMail can treat Japanese texts specially.
But ActionMailer does not use this capability. So Japanese
developers use some monkey patches.
This is an implementation in Ruby-GetText-Package.
Other locales
Now we can support other locales with Ruby 1.9.
TMail and Ruby-GetText-Package treats Japanese text specially. I
think this is because
- Ancient versions of Ruby did not have Iconv,
- Iconv is too platform-depended,
- NKF and Kconv only supports Japanese,
- Both of the original developers of the libraries are
Japanese.
According to RFC 1557, Korean emails should be encoded in
ISO-2022-KR.
I don't know enough about custom in other locales like
Chinese/Vietnamese/Arabic. But Maybe this kind of problem can occur
in these locales.
TODO
- ActionMailer should have capability to send an email in other
encodings.
- with String#encode in Ruby 1.9.
- Default mapping from language to preferred encoding so that a
programmer assign a suitable encoding to an email by locale name.
- Suitable encoding is not unique for a language. Japanese mobile
phones which Softbank provides prefer UTF-8.
- TMail might need some fixes.
- Advices by Chinese/Vietnamese/Arabic/.... developers are
necessary.