aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--app/models/incoming_message.rb13
-rw-r--r--todo.txt4
2 files changed, 16 insertions, 1 deletions
diff --git a/app/models/incoming_message.rb b/app/models/incoming_message.rb
index 88748c28d..9e2141661 100644
--- a/app/models/incoming_message.rb
+++ b/app/models/incoming_message.rb
@@ -19,7 +19,7 @@
# Copyright (c) 2007 UK Citizens Online Democracy. All rights reserved.
# Email: francis@mysociety.org; WWW: http://www.mysociety.org/
#
-# $Id: incoming_message.rb,v 1.15 2007-12-24 18:30:34 francis Exp $
+# $Id: incoming_message.rb,v 1.16 2007-12-31 02:30:52 francis Exp $
class IncomingMessage < ActiveRecord::Base
belongs_to :info_request
@@ -99,12 +99,23 @@ class IncomingMessage < ActiveRecord::Base
end
end
text = best_part.body
+ text_charset = best_part.charset
else
# Just turn them all into text using built in
text = self.mail.body
+ text_charset = self.mail.charset
end
else
text = self.mail.body
+ text_charset = self.mail.charset.to_s
+ end
+
+ # Charset conversion, turn everything into UTF-8
+ if not text_charset.nil?
+ if text_charset == 'us-ascii'
+ # Emails say US ASCII, but mean ISO-8859-1
+ text = Iconv.conv('utf-8', 'iso-8859-1', text)
+ end
end
# Format the body text...
diff --git a/todo.txt b/todo.txt
index 61f78625b..e84e4c863 100644
--- a/todo.txt
+++ b/todo.txt
@@ -16,9 +16,13 @@ the Oxford Economic Forecasting's report "The Economic Contribution of the
Aviation Industry in the UK" in the "Air Transport White Paper Progress Report
2006"
+DTI CAM one
+
Next
====
+sent_at - record when resent
+
Track bounce messages via a separate address
- just record if they are bounce, and any DSN, for now
- and say in display "automatic message"