Forum: Ruby on Rails ActionMailer encoding

Announcement (2017-05-07): www.ruby-forum.com is now read-only since I unfortunately do not have the time to support and maintain the forum any more. Please see rubyonrails.org/community and ruby-lang.org/en/community for other Rails- und Ruby-related community platforms.
Spacen Jasset (Guest)
on 2007-07-01 02:11
(Received via mailing list)
Hi,

I am using ActionMailer to recieve emails as per the usual method. I
use postfix.

My Database is setup for utf8 encoding. I get a database error when I
try to store email.body into a record in the database. This means that
action mailer is returning the body string in the original email
encoding.

abstract_adapter.rb:128:in `log': RuntimeError: ERROR        C22021
Minvalid byte sequence for encoding "UTF8": 0x92

Mime-Version: 1.0
Content-Type: text/plain; charset=ISO-8859-1

How should I handle this? Must I use Iconv to manually convert this
data by examining the content-type field of the email? The body must
end up in utf8 form when it gets stored into the database.

Regards,

Jason
This topic is locked and can not be replied to.