diff options
author | Louise Crow <louise.crow@gmail.com> | 2012-10-09 18:26:22 +0100 |
---|---|---|
committer | Louise Crow <louise.crow@gmail.com> | 2012-10-09 18:26:22 +0100 |
commit | 83ba03721adb4b2446d38aaef9d11522d3a880dc (patch) | |
tree | dbc39556c84996dd67eedc87fd0ad7e2a57cfbb9 /app/models | |
parent | 3c69d999dfdc09d8ad94c4d8e36c61b4fc0dd127 (diff) |
Handle the case where an incoming message is badly encoded and has no charset on the part we're using as a main part.
Diffstat (limited to 'app/models')
-rw-r--r-- | app/models/incoming_message.rb | 1 |
1 files changed, 1 insertions, 0 deletions
diff --git a/app/models/incoming_message.rb b/app/models/incoming_message.rb index 17066a375..fcb4671c5 100644 --- a/app/models/incoming_message.rb +++ b/app/models/incoming_message.rb @@ -644,6 +644,7 @@ class IncomingMessage < ActiveRecord::Base # Text looks like unlabelled nonsense, # strip out anything that isn't UTF-8 begin + source_charset = 'utf-8' if source_charset.nil? text = Iconv.conv('utf-8//IGNORE', source_charset, text) + _("\n\n[ {{site_name}} note: The above text was badly encoded, and has had strange characters removed. ]", :site_name => Configuration::site_name) |