[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: bug#32236: df header corrupted with LANG=zh_TW.UTF-8 on macOS
From: |
Pádraig Brady |
Subject: |
Re: bug#32236: df header corrupted with LANG=zh_TW.UTF-8 on macOS |
Date: |
Sun, 22 Jul 2018 09:17:07 -0700 |
User-agent: |
Mozilla/5.0 (X11; Linux x86_64; rv:45.0) Gecko/20100101 Thunderbird/45.8.0 |
On 22/07/18 08:12, Paul Eggert wrote:
> Pádraig Brady wrote:
>> I've also attached an alternative patch for df (in your name).
>
> That still has problems, since it can generate improperly-encoded strings in
> UTF-8 locales (if the inputs are improperly encoded), and can replace parts
> of
> multibyte characters with '?' in non-UTF-8 locales. Please try the attached
> patch instead, which attempts to address these issues. This is more along the
> lines that Bruno suggested, except it doesn't use mbsiter as I figured it was
> simpler overall just to use mbrtowc directly for this one thing.
I haven't time to review this now,
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.
This subset of control characters is safe to identify
It seems problematic to start eliding improperly encoded
mount points for example, rather than just outputting
what's there.
Also just incrementing width++ per each wide character
doesn't seem right, though again I've not tested it.
cheers,
Pádraig
- Re: bug#32236: df header corrupted with LANG=zh_TW.UTF-8 on macOS, (continued)
- Re: bug#32236: df header corrupted with LANG=zh_TW.UTF-8 on macOS, Chih-Hsuan Yen, 2018/07/25
- Re: bug#32236: df header corrupted with LANG=zh_TW.UTF-8 on macOS, Paul Eggert, 2018/07/26
- Re: bug#32236: df header corrupted with LANG=zh_TW.UTF-8 on macOS, Bruno Haible, 2018/07/26
- Re: bug#32236: df header corrupted with LANG=zh_TW.UTF-8 on macOS, Pádraig Brady, 2018/07/26
- Re: bug#32236: df header corrupted with LANG=zh_TW.UTF-8 on macOS, Paul Eggert, 2018/07/26
- Re: bug#32236: df header corrupted with LANG=zh_TW.UTF-8 on macOS, Bruno Haible, 2018/07/27
- Re: bug#32236: df header corrupted with LANG=zh_TW.UTF-8 on macOS, Paul Eggert, 2018/07/27
- Re: bug#32236: df header corrupted with LANG=zh_TW.UTF-8 on macOS, Chih-Hsuan Yen, 2018/07/29
Re: bug#32236: df header corrupted with LANG=zh_TW.UTF-8 on macOS, Paul Eggert, 2018/07/22