aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorLouise Crow <louise.crow@gmail.com>2013-02-06 14:45:52 +0000
committerLouise Crow <louise.crow@gmail.com>2013-02-06 14:45:52 +0000
commitc2f431b7160b898111c4f2f3b7cba6d4513bc3b5 (patch)
tree076746f4d9c6c46c1b6eae66d020100d86f1aeec
parentd83e97215634999e30585ef45f562cc009da27d8 (diff)
Rescue an invalid character exception when handling what appears to be badly encoded data.
-rw-r--r--app/models/incoming_message.rb2
1 files changed, 1 insertions, 1 deletions
diff --git a/app/models/incoming_message.rb b/app/models/incoming_message.rb
index 3f551f420..5c845ead3 100644
--- a/app/models/incoming_message.rb
+++ b/app/models/incoming_message.rb
@@ -535,7 +535,7 @@ class IncomingMessage < ActiveRecord::Base
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)
- rescue Iconv::InvalidEncoding, Iconv::IllegalSequence
+ rescue Iconv::InvalidEncoding, Iconv::IllegalSequence, Iconv::InvalidCharacter
if source_charset != "utf-8"
source_charset = "utf-8"
retry