GNU bug report logs - #32236
df header corrupted with LANG=zh_TW.UTF-8 on macOS

Previous Next

Package: coreutils;

Reported by: Chih-Hsuan Yen <yan12125 <at> gmail.com>

Date: Sat, 21 Jul 2018 16:10:02 UTC

Severity: normal

Done: Paul Eggert <eggert <at> cs.ucla.edu>

Bug is archived. No further changes may be made.

Full log


View this message in rfc822 format

From: Pádraig Brady <P <at> draigBrady.com>
To: 32236 <at> debbugs.gnu.org, eggert <at> cs.ucla.edu, yan12125 <at> gmail.com
Subject: bug#32236: df header corrupted with LANG=zh_TW.UTF-8 on macOS
Date: Sun, 3 Mar 2019 14:53:56 -0800
[Message part 1 (text/plain, inline)]
On 26/07/18 18:23, Paul Eggert wrote:
> Pádraig Brady wrote:
>> I've pushed the c_iscntrl patch since it's simplest
>> and probably most appropriate patch for an existing release.
> 
> Yes, that makes sense for a quick patch. However, for the next release I think 
> it'd be better to catch encoding errors and multibyte control characters, given 
> the problems noted. I installed the attached further patch to try to do this. 
> This fixes the problem that Bruno noted, along with two others; my earlier patch 
> neglected the possibility that mbrtowc can return 0, and it incorrectly assumed 
> wide control characters always have a single-byte representation.
> 
> Either way the original bug appears to be fix so I'm boldly closing the bug report.

Reviewing this, I dislike the way that we're now enforcing that
the file system locale needs to match the current user's locale
or otherwise df will not output all original characters.
That has the potential to break scripts, as mismatched
encodings is a common issue.

In the attached I've taken the original less aggressive replacement
policy when not outputting to a tty, leaving more sanitizing to the tty case.

cheers,
Pádraig
[df-relax-encoding.patch (text/x-patch, attachment)]

This bug report was last modified 6 years and 160 days ago.

Previous Next


GNU bug tracking system
Copyright (C) 1999 Darren O. Benham, 1997,2003 nCipher Corporation Ltd, 1994-97 Ian Jackson.