diff options
author | Louise Crow <louise.crow@gmail.com> | 2015-05-26 13:47:57 +0100 |
---|---|---|
committer | Louise Crow <louise.crow@gmail.com> | 2015-06-04 15:48:56 +0100 |
commit | 6e621bcfde5609a692f964c2e16c0c74796f2d3b (patch) | |
tree | e2b9fb043876095d14adf44ff1be3f87aef7c4a0 /lib | |
parent | 51a532f797d942dfc5e83537ca1c9f4217bd757a (diff) |
Make sure spelling corrections are encoded as UTF-8
Diffstat (limited to 'lib')
-rw-r--r-- | lib/acts_as_xapian/acts_as_xapian.rb | 5 |
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 |