aboutsummaryrefslogtreecommitdiffstats
path: root/lib/acts_as_xapian
diff options
context:
space:
mode:
authorLouise Crow <louise.crow@gmail.com>2015-05-26 13:47:57 +0100
committerLouise Crow <louise.crow@gmail.com>2015-05-28 10:44:10 +0100
commitca84f7b51f9c95fea57aca9ab5b1d911b467831f (patch)
treebd2dfc03efad6228e2767071fcd0d36ae14ab009 /lib/acts_as_xapian
parentcf9f0b6096872557005bf92433ea3499697713f0 (diff)
Make sure spelling corrections are encoded as UTF-8
Diffstat (limited to 'lib/acts_as_xapian')
-rw-r--r--lib/acts_as_xapian/acts_as_xapian.rb5
1 files changed, 4 insertions, 1 deletions
diff --git a/lib/acts_as_xapian/acts_as_xapian.rb b/lib/acts_as_xapian/acts_as_xapian.rb
index 6520a20a4..48d0b0554 100644
--- a/lib/acts_as_xapian/acts_as_xapian.rb
+++ b/lib/acts_as_xapian/acts_as_xapian.rb
@@ -375,7 +375,10 @@ module ActsAsXapian
if correction.empty?
return nil
end
- return correction
+ if correction.respond_to?(:force_encoding)
+ correction = correction.force_encoding('UTF-8')
+ end
+ correction
end
# Return array of models found