On 21/07/18 07:20, Chih-Hsuan Yen wrote: > Hi coreutils developers, > > I'm using coreutils on macOS High Sierra (10.13). I noticed that with > `LANG=zh_TW.UTF-8`, `df` output is corrupted. > > �?�?系統 容�?? 已�?� �?��?� 已�?�% �??�?�? > /dev/disk1s1 234G 151G 81G 65% / > /dev/disk1s4 234G 2.1G 81G 3% /private/var/vm > > (I'm not sure if other mail agents can display those characters > correctly or not. See my blog post [1] for the exact output.) > > Seems it's similar to bug#25630 [2], which is not resolved. I guess > the reason of my issue is that iscntrl() is broken on macOS High > Sierra, so in hide_problematic_chars(), some bytes in the Chinese > header is replaced with a question mark. I managed to patch coreutils > [3] to make `df` work. Could you have a look? Thanks! > > Best, > > Chih-Hsuan Yen > > [1] https://blog.chyen.cc/posts/2018/06/23/mac-df-chinese.html > [2] http://lists.gnu.org/archive/html/bug-coreutils/2017-02/msg00008.html > [3] https://github.com/yan12125/macports-ports/blob/fix-coreutils-df-chinese/sysutils/coreutils/files/patch-df.diff Wow. That's surprising. I do see the FreeBSD man pages say: "The 4.4BSD extension of accepting arguments outside of the range of the unsigned char type in locales with large character sets is considered obsolete and may not be supported in future releases." Now I think that might have been referring to >= 0xFF, but fair enough. I've attached a gnulib patch to document for iscntrl at least. It would be great if someone could test the other is*() classification functions on macOS so that I might have a more complete documentation patch. I've also attached an alternative patch for df (in your name). Can you try that one? thanks! Pádraig