Discussion:
matching base character
Pádraig Brady
2006-07-10 08:58:20 UTC
Permalink
Hi,

How does one compare characters using only primary weights?

For example I would like "a á â" to be equal according to the locale.
I think that strcoll will treat them as equal using primary weight,
but then iterate again to compare with secondary and tertiary weights.

thanks,
Pádraig.
Danilo Segan
2006-07-13 15:01:05 UTC
Permalink
Post by Pádraig Brady
How does one compare characters using only primary weights?
For example I would like "a á â" to be equal according to the locale.
I think that strcoll will treat them as equal using primary weight,
but then iterate again to compare with secondary and tertiary weights.
Perhaps write your own locale for that and set LC_COLLATE to it? On
GNU libc systems, you can have them locally installed (eg. in your
$HOME) as well using I18NPATH and LOCPATH environment variables.

Cheers,
Danilo
William J Poser
2006-07-15 02:37:23 UTC
Permalink
Another way of getting a non-standard sort order is to use
a sort utility that allows you to specify the sort order explicitly.
My own contribution is msort (http://billposer.org/Software/msort.html).

Bill Poser

Loading...