On Sep 23, 2006, at 12:56 AM, David Balmain wrote:
> I don't really have any other ideas. Did you re-index the data after
> you set ENV["LANG"]? Could you try this code and tell me what you get;
>
>     require 'rubygems'
>     require 'ferret'
>     p Ferret::VERSION # 0.10.6
>     p Ferret::locale # "en_US.UTF-8"
>
>     index = Ferret::I.new()
>
>     index << {:place => "Gazima\304\237usa"}
>     index << {:place => "U.S.A."}
>     puts "Search: USA"
>     index.search_each("USA") {|id, score| puts index[id][:place]}
>     # Search: USA
>     # U.S.A.
>
>     puts "Search: Gazima\304\237usa"
>     index.search_each("Gazima\304\237usa") {|id, score| puts index 
> [id][:place]}
>     # Search: Gazimağusa
>     # Gazimağusa

In the end, setting ENV['LANG'] didn't seem to have an effect, but  
setting Ferret::locale directly seems to work:

Ferret::locale = 'en_US.UTF-8'

Thanks!

Francis

_______________________________________________
Ferret-talk mailing list
[email protected]
http://rubyforge.org/mailman/listinfo/ferret-talk

Reply via email to