> From: Dan Jacobson <[EMAIL PROTECTED]> > Date: 14 Jul 2001 10:24:16 +0800 > > >>>>> "Dan" == Dan Jacobson <[EMAIL PROTECTED]> writes: > > Dan> What is my problem? I tried sort(1) with all kinds of options and > Dan> LC_COLLATE etc... but still can't get these wide numbers into order. > Dan> sort (GNU textutils) 2.0 > [The screen shows wide square versions of the narrow ASCII 1 2 6 3 4 5 7] > > Wait, that was with > LC_COLLATE=zh_TW.Big5 > but now with > LC_COLLATE=C all the switches sort fine [but -m and -z, no big deal] > gee, one would think that for proper behaviour in a zh_TW.Big5 > environment, one would want all the LC stuff set to zh_TW.Big5, > but what do you know, if you want to sort Chinese numbers you got to > turn them off. That sounds like a bug in the LC_COLLATE locale on your host. You can investigate this problem with the following little program. Try invoking it with pairs of Chinese digits, in the zh_TW.Big5 locale. #include <stdio.h> #include <locale.h> #include <string.h> int main (int argc, char **argv) { if (argc != 3) { fprintf (stderr, "%s: usage: %s string1 string2\n", argv[0], argv[0]); return 1; } else if (! setlocale (LC_ALL, "")) { fprintf (stderr, "%s: setlocale failed\n", argv[0]); return 1; } else { int i = strcoll (argv[1], argv[2]); if (i > 0) printf (">\n"); if (i < 0) printf ("<\n"); if (i == 0) printf ("==\n"); return 0; } } _______________________________________________ Bug-textutils mailing list [EMAIL PROTECTED] http://mail.gnu.org/mailman/listinfo/bug-textutils