Subject: Re: Is it necessary?
From: Ondřej Jirman
Date: Mon, 13 Feb 2023 10:04:43 +0100
Hello,

On Sat, Feb 11, 2023 at 01:24:07PM +0000, bardicristi@yahoo.com wrote:
> Hi
> I noticed you removed the "y" output printed messages (Visual bug) and answered as "won't fix".
> 
> My question is if it's necessary for df -h to output nbsp (a unicode space
> 0xC2 0xA0) between size and unit instead of standard acii space (0x20)? That's
> the "y" the other poster saw as well and now, in this latest build it's
> something else.

This is done by a lower level function megatools is using g_format_size_full.

The function has flags to print only value or unit in glib 2.74
https://docs.gtk.org/glib/flags.FormatSizeFlags.html but 2.74 is very new,
so I can't use it yet.

> Since in my batch scripts that's what I've encountered as well. Afterall we're
> not manipulating html... but plain text and it doesn't play well with batch
> commands. Can't split it with IF or SET not does chcp to uncide and actually
> pasting that nbsp char in the batch file do anything. Without -h I have to
> deploy some math app to be able to turn 20 GB in bytes into 20 GB plain.

If you're using the df output for further processing and not for human display,
don't use --human flag. Than you can process the output values as you like,
because they'll be in bytes.

regards,
	o.

> Just curious.