For lexicographic ordering comm(1) compares chars without specified signedness. So, when 'char' is 'signed char', comm assumes that UTF-8 multibyte units appear before ASCII. Must force unsigned comparison to ensure compatibility with sort(1) beyond 7 bits. Test: comm <{echo Bar; echo Bär} <{echo Bär; echo Foo} Reference: /n/sources/patch/comm-utf-sort Date: Wed Aug 30 18:19:27 CES 2017 Signed-off-by: antox@ml.lv --- /sys/src/cmd/comm.c Wed Aug 30 18:19:04 2017 +++ /sys/src/cmd/comm.c Wed Aug 30 18:19:01 2017 @@ -156,7 +156,7 @@ a++; b++; } - if(*a < *b) + if((uchar)*a < (uchar)*b) return 1; return 2; }