sort -df oddly assumes rune 0xff applies to all larger runes. compute the actual key. Reference: /n/sources/patch/maybe/sort-df-rune Date: Thu Mar 13 16:33:40 CET 2014 Signed-off-by: quanstro@quanstro.net --- /sys/src/cmd/sort.c Thu Mar 13 16:01:00 2014 +++ /sys/src/cmd/sort.c Thu Mar 13 16:00:59 2014 @@ -1292,14 +1292,14 @@ /* * for characters out of range, * the table does not do Rflag. - * ignore is based on mapto[nelem(f->mapto)-1] + * ignore is computed directly. */ if(c != 0 && c < nelem(f->mapto)) { c = f->mapto[c]; if(c == 0) continue; } else { - if(f->mapto[nelem(f->mapto)-1] == 0) + if(f->flags & Iflag) continue; /* * consider building maps as necessary