aboutsummaryrefslogtreecommitdiffstats
path: root/lib
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-06-04 12:22:04 +0100
commite64c0657c3d3ed0ca2349fd0344d6b43213c4008 (patch)
treefb8ec5ef894bae745043d1e6ad360219ebb838c7 /lib
parent592434c4b2b8e58416b3cdb3a66513ac206576d1 (diff)
Make sure spelling corrections are encoded as UTF-8
Diffstat (limited to 'lib')
-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 f742bae52..9194e8cc4 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