I get the following PGError when swallowing Rails emails from Cloudmailin:
PGError: ERROR: invalid byte sequence for encoding "UTF8": 0xbb HINT: This error can also happen if the byte sequence does not match the encoding expected by the server, which is controlled by "client_encoding". : INSERT INTO "comments" ("content") VALUES ('Reply with blah blah .....
So, it seems pretty clear that some invalid UTF8 characters get in the email? So I tried to clear it, but something else sneaked in. Here is what I still have:
message_all_clean = params[:message] Iconv.conv('UTF-8//IGNORE', 'UTF-8', message_all_clean) message_plain_clean = params[:plain] Iconv.conv('UTF-8//IGNORE', 'UTF-8', message_plain_clean) @incoming_mail = IncomingMail.create(:message_all => Base64.encode64(message_all_clean), :message_plain => Base64.encode64(message_plain_clean))
Any ideas, thoughts or suggestions? Thanks
ruby-on-rails encoding postgresql ruby-on-rails-3 heroku
Anapprentice
source share