From: unbewusst.sein@... (=?ISO-8859-1?Q?Une_B=E9v?= =?ISO-8859-1?Q?ue?=) Date: 2007-12-07T04:40:12+09:00 Subject: sorting Array of accentuated Strings I've done a "self <=> anotherString" comparaison which works by itself : class String def <=>( aString ) [blahblahblah] end end however if i want to sort an Array of Strings, the Array is sorted as usual within Ruby (put accentuated characters at the end) : a = [ "�tre", "Fen�tre", "Etre" ] b = a.sort { | i, j | i <=> j } puts "b = [ " + b.join(", ") + " ]\n" # => b = [ Etre, �tre, Fen�tre ] c = a.sort #<=>( aString ) NOT CALLED... puts "c = [ " + c.join(", ") + " ]\n" # => c = [ Etre, Fen�tre, �tre ] Why, in the case of "c = a.sort", #<=>( aString ) isn't called ? the comparaison within an Array could compare different kind of objects like : a = [ 0, "a", 9, Time.new ] ??? -- Une B�vue