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 12:22:04 +0100 |
| commit | e64c0657c3d3ed0ca2349fd0344d6b43213c4008 (patch) | |
| tree | fb8ec5ef894bae745043d1e6ad360219ebb838c7 /lib | |
| parent | 592434c4b2b8e58416b3cdb3a66513ac206576d1 (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 |
