[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
bug#32236: df header corrupted with LANG=zh_TW.UTF-8 on macOS
From: |
Bruno Haible |
Subject: |
bug#32236: df header corrupted with LANG=zh_TW.UTF-8 on macOS |
Date: |
Sun, 22 Jul 2018 23:35:21 +0200 |
User-agent: |
KMail/5.1.3 (Linux/4.4.0-130-generic; KDE/5.18.0; x86_64; ; ) |
Pádraig Brady wrote:
> but I did want to only avoid \n etc. that might cause issues for
> programs that parsed output from df on a line by line basis.
The current code (which uses iscntrl) also catches escape sequences
that can cause weird output on the screen, in a terminal emulator.
This is good (because it can confuse a human reader as much as a '\n'
would confuse a line-by-line parser).
Now, this feature currently only works for escape sequence that
start with an ASCII escape U+001B. It would be useful also for
other control characters to be caught, at least:
* escape characters U+009B.
* other characters that cause a newline in a terminal emulator:
U+2028 and U+2029.
For example, in konsole, the escape sequence '\u009bf' repositions
the cursor. So the effects of
$ mkdir /tmp/`printf 'abc\u009bf'`
$ sudo mount -r -t iso9660 -o loop /some/iso/image.iso /tmp/abc*
$ df
...
/dev/loop0 1986048 1986048 0 100% /tmp/abc�f
is that 'df' produces an U+FFFD. This is less useful than what
it produces for an ASCII escape:
$ mkdir /tmp/`printf 'abc\u001b[2J'`
$ sudo mount -r -t iso9660 -o loop /some/iso/image.iso /tmp/abc*
$ df
...
/dev/loop0 692828 692828 0 100% /tmp/abc?[2J
Bruno
- bug#32236: df header corrupted with LANG=zh_TW.UTF-8 on macOS, (continued)
- bug#32236: df header corrupted with LANG=zh_TW.UTF-8 on macOS, Bruno Haible, 2018/07/26
- bug#32236: df header corrupted with LANG=zh_TW.UTF-8 on macOS, Pádraig Brady, 2018/07/26
- bug#32236: df header corrupted with LANG=zh_TW.UTF-8 on macOS, Paul Eggert, 2018/07/26
- bug#32236: df header corrupted with LANG=zh_TW.UTF-8 on macOS, Bruno Haible, 2018/07/27
- bug#32236: df header corrupted with LANG=zh_TW.UTF-8 on macOS, Paul Eggert, 2018/07/27
- bug#32236: df header corrupted with LANG=zh_TW.UTF-8 on macOS, Chih-Hsuan Yen, 2018/07/29
bug#32236: df header corrupted with LANG=zh_TW.UTF-8 on macOS, Paul Eggert, 2018/07/22