ActionMailer charset support

12 views
Skip to first unread message

Luca Guidi

unread,
Jul 1, 2008, 11:06:50 AM7/1/08
to rails...@googlegroups.com
Hi all,
I just introduced the charset support for ActionMailer:
http://github.com/svenfuchs/rails/commit/6982acb0793fb6e59f52cab4062344a88e3691ce

AM now transparently sets the charset (from the current locale) for
emails (single-part and multi-part).

Of course, the charset declaration uses the I18n syntax:
I18n.backend.store_translations :'en-US', {
:charset => 'utf-8'
}

--
blog: www.lucaguidi.com
Pro-Netics: www.pro-netics.com
Sourcesense - making sense of Open Source: www.sourcesense.com

Sven Fuchs

unread,
Jul 1, 2008, 2:11:09 PM7/1/08
to rails...@googlegroups.com
Awesome, Luca!

Looks very good. Have you had the chance to test this in a "real"
environment, already?

--
sven fuchs sven...@artweb-design.de
artweb design http://www.artweb-design.de
grünberger 65 + 49 (0) 30 - 47 98 69 96 (phone)
d-10245 berlin + 49 (0) 171 - 35 20 38 4 (mobile)

Joshua Harvey

unread,
Jul 2, 2008, 2:33:55 PM7/2/08
to rails...@googlegroups.com
Hi Luca, thanks for the work your doing. Sven and I talked about this,
and we'd like to leave the ActionMailer stuff out for this release.
We're really pushing to keep this as minimal as possible and we think
the charset part needs some further thought. For instance, if we're
setting the charset for emails, why aren't we setting the charset for
all web page requests? It might be too much of an assumption to make
for the developer.

Of course, we could be missing something, so feel free to keep the
discussion going.

Best,
Josh

Luca Guidi

unread,
Jul 2, 2008, 4:40:13 PM7/2/08
to rails...@googlegroups.com
Joshua Harvey wrote:
> For instance, if we're
> setting the charset for emails, why aren't we setting the charset for
> all web page requests? It might be too much of an assumption to make
> for the developer.
I agree with you, it isn't a trivial issue to set-up the correct charset
for AP. For this reason I started with AM, because is less critical than
the request/response cycle. I think it could be a painless opportunity
to introduce the localized charset support.

The default in en-US.rb is utf-8, the same value of
AM:Base#default_charset. So, if a developer doesn't like this feature or
just wouldn't use it, AM will deliver unicode mails.

Best,
Luca

Reply all
Reply to author
Forward
0 new messages