Sorting with non-ASCII characters

monarch_dodra monarchdodra at gmail.com
Thu Sep 19 08:34:27 PDT 2013


On Thursday, 19 September 2013 at 15:18:11 UTC, Chris wrote:
> Short question in case anyone knows the answer straight away:
>
> How do I sort text so that non-ascii characters like "á" are 
> treated in the same way as "a"?
>
> Now I'm getting this:
>
> [wow, ara, ába, marca]
>
> ===> sort(listAbove);
>
> [ara, marca, wow, ába]
>
> I'd like to get:
>
> [ ába, ara, marca, wow]
>
> Thanks.

Short answer, we currently can't, because we haven't implemented 
the "Unicode Collation Algorithm"
http://d.puremagic.com/issues/show_bug.cgi?id=10566

Unfortunately, I don't know of any workarounds for you :/


More information about the Digitalmars-d-learn mailing list