13
Is it possible to sort an array of values using a specific collation in Ruby? I have a need to sort according to the da_DK collation.
Given the array %w(Aarhus Aalborg Assens) I would like to have ['Assens', 'Aalborg', 'Aarhus'] back which is the correct order in Danish.
The standard sort method
%w(Aarhus Aalborg Assens).sort
returns something that looks like the ascii order (at least not the Danish order):
["Aalborg", "Aarhus", "Assens"]
The environment is both Snow Leopard and linux running ruby 1.9.2 and Rails 3.0.5.