Table of strings sorting problem

Aarti aarti at interia.pl
Sat Mar 11 11:54:10 PST 2006


John C wrote:

> As others have implied, D's standard library isn't culturally aware.
> 
> I've been working on a locale package for Mango that will eventually 
> allow correct string sorting for specific languages. This is how you'd 
> sort a list of Polish characters:
> 
> const char[][] table = [ "a","ą","c","ć","e","ę" ];
> Culture.current = Culture.getCulture("pl-PL");
> table.sort();

It would be really helpful! Does it already work? I especially don't 
understand how can I change standard behaviour of table sort property?

I think that internationalization support is one of most important areas 
which could increase D acceptance all over the world.

Althrough in C++ it's not as easy as it should be, but it's still easier 
than making own sort function. Especially when I want in my program that 
sorting according to rules of _many_ different languages should be 
supported.

Another problem is that D documentation does not say anything that D 
sorts tables only in binary order. There should be also hint how to 
implement own sorters for table, because now language does not behave as 
expected in case of strings.

Regards
Marcin Kuszczak



More information about the Digitalmars-d mailing list