aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorLouise Crow <louise.crow@gmail.com>2015-06-12 15:13:50 +0100
committerLouise Crow <louise.crow@gmail.com>2015-06-22 17:43:22 +0100
commit7983e37506f3fa16211255ef802bf50735adbdb8 (patch)
tree8b033b1bd97f74298e8a89a300b3f248213f0fc5
parent78e73a009af36170213d77fee204718dc0d70cf0 (diff)
Use existing UTF-8 conversion method.
-rw-r--r--app/models/incoming_message.rb11
1 files changed, 1 insertions, 10 deletions
diff --git a/app/models/incoming_message.rb b/app/models/incoming_message.rb
index 362866aa4..a84e9dd3a 100644
--- a/app/models/incoming_message.rb
+++ b/app/models/incoming_message.rb
@@ -615,16 +615,7 @@ class IncomingMessage < ActiveRecord::Base
end
def _get_attachment_text_internal
- text = self._extract_text
-
- # Remove any bad characters
- if String.method_defined?(:encode)
- # handle "problematic" encoding
- text.encode!('UTF-16', 'UTF-8', :invalid => :replace, :undef => :replace, :replace => '')
- text.encode('UTF-8', 'UTF-16')
- else
- Iconv.conv('utf-8//IGNORE', 'utf-8', text)
- end
+ convert_string_to_utf8(_extract_text, 'UTF-8').string
end
# Returns text for indexing