diff options
author | Louise Crow <louise.crow@gmail.com> | 2012-12-06 10:51:28 +0000 |
---|---|---|
committer | Louise Crow <louise.crow@gmail.com> | 2012-12-06 14:15:58 +0000 |
commit | bde6ceeb95295ddb9b018530833a9f12280fa341 (patch) | |
tree | d4ab5bc806db675ffbdd0c6f4fcb1e576f1d0bea | |
parent | 9540745fd41c5799636b4b5341c8c0f0ee32852f (diff) |
Update comments to reflect the fact that text is coming from an foi attachment model, and hasn't necessarily been handled by TMail.
-rw-r--r-- | app/models/incoming_message.rb | 7 |
1 files changed, 4 insertions, 3 deletions
diff --git a/app/models/incoming_message.rb b/app/models/incoming_message.rb index a2d65a9ac..f9af3bfa6 100644 --- a/app/models/incoming_message.rb +++ b/app/models/incoming_message.rb @@ -457,7 +457,8 @@ class IncomingMessage < ActiveRecord::Base text = "[ Email has no body, please see attachments ]" source_charset = "utf-8" else - text = part.body # by default, TMail converts to UTF8 in this call + # by default, the body (coming from an foi_attachment) should have been converted to utf-8 + text = part.body source_charset = part.charset if part.content_type == 'text/html' # e.g. http://www.whatdotheyknow.com/request/35/response/177 @@ -465,7 +466,7 @@ class IncomingMessage < ActiveRecord::Base # convert to text routine. Could instead call a # sanitize HTML one. - # If the text isn't UTF8, it means TMail had a problem + # If the text isn't UTF8, it means we had a problem # converting it (invalid characters, etc), and we # should instead tell elinks to respect the source # charset @@ -479,7 +480,7 @@ class IncomingMessage < ActiveRecord::Base end end - # If TMail can't convert text, it just returns it, so we sanitise it. + # If text hasn't been converted, we sanitise it. begin # Test if it's good UTF-8 text = Iconv.conv('utf-8', 'utf-8', text) |