From ca84f7b51f9c95fea57aca9ab5b1d911b467831f Mon Sep 17 00:00:00 2001 From: Louise Crow Date: Tue, 26 May 2015 13:47:57 +0100 Subject: Make sure spelling corrections are encoded as UTF-8 --- lib/acts_as_xapian/acts_as_xapian.rb | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) (limited to 'lib') 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 -- cgit v1.2.3