Permalink
Browse files

now required unicode_utils gem in ruby 1.9 to correctly downcase unic…

…ode chars
  • Loading branch information...
1 parent fb6da5e commit e05633f929366a68e8c1b2c0982b34f32407b079 @jfahrenkrug committed Jan 24, 2013
Showing with 3 additions and 2 deletions.
  1. +3 −2 lib/xapit.rb
View
@@ -1,6 +1,7 @@
require 'digest/sha1'
require 'rubygems'
require 'xapian'
+require "unicode_utils/upcase" if RUBY_VERSION > "1.9"
# hack to convert iso-8859-15 strings to utf-8 and downcase them safely
class String
@@ -12,9 +13,9 @@ def xapit_utf8_downcase
return Iconv.iconv('UTF-8//IGNORE//TRANSLIT', 'ISO-8859-15', self)[0].mb_chars.downcase.to_s
rescue Exception
end
+ else
+ return UnicodeUtils.downcase(self)
end
-
- self.mb_chars.downcase.to_s
end
end

0 comments on commit e05633f

Please sign in to comment.