Package: locales
Version: 2.1.3-10
Severity: wishlist
The Swedish standards say that the letters "V" and "W" should be considered
identical when sorting (this is used in all dictionaries, phone books etc.).
However, a small test program shows that glibc's locales do not think so:
$ ./sortme sv_SE
Using locale: sv_SE
0. Aasen
1. Asen
2. V�sen
3. Wasa
4. �sen
5. �sen
6. �sen
Numbers 2 and 3 should be the other way around (i.e "Wasa" before "V�sen").
====[ sortme.c ]====
#include <string.h>
#include <stdio.h>
#include <locale.h>
#include <stdlib.h>
static int do_strcoll(const void *p1, const void *p2)
{
return strcoll(*(const char **) p1, *(const char **) p2);
}
int main(int argc, char *argv[])
{
char *words[] = { "�sen", "Aasen", "�sen", "Asen", "�sen", "V�sen", "Wasa" };
int i;
if (argc < 2) return -1;
printf("Using locale: %s\n", argv[1]);
setlocale(LC_COLLATE, argv[1]);
qsort((void *) words, 7, sizeof (char *), do_strcoll);
for (i = 0; i < 7; i ++)
printf("%d. %s\n", i, words[i]);
return 0;
}
====[ sortme.c ]====
-- System Information
Debian Release: 2.2
Kernel Version: Linux perkele 2.2.15 #4 m�n jul 10 20:50:07 CEST 2000 i586 unknown
Versions of the packages locales depends on:
ii libc6 2.1.3-10 GNU C Library: Shared libraries and
Timezone data
--
To UNSUBSCRIBE, email to [EMAIL PROTECTED]
with a subject of "unsubscribe". Trouble? Contact [EMAIL PROTECTED]