On Sun, Feb 12, 2017 at 09:21:37PM +0100, Walter Alejandro Iglesias wrote:
> After investigating a bit I realized that what I called utf8 space is a
> 'nobreakspace' so it's ok fmt to replace them for ascii ones.  I made a
> stupid question.  Sorry!

If that's the behavior you see, I think _that_ is a bug: the reason
non-breaking spaces exist is so programs do not separate words at that
character (https://en.wikipedia.org/wiki/Non-breaking_space). GNU fmt
respects non-breaking spaces and handles them accordingly:

    ~$ fmt --version | head -n1
    fmt (GNU coreutils) 8.25
    ~$ printf "XXXX XXXXXXXXXXXXXXX\u00a0XXX XXX" | fmt -w 20
    XXXX
    XXXXXXXXXXXXXXX XXX
    XXX
    ~$ printf "XXXX XXXXXXXXXXXXXXX XXX XXX" | fmt -w 20
    XXXX
    XXXXXXXXXXXXXXX
    XXX XXX

Unfortunately I do not have access to an OpenBSD machine to verify
whether or not its fmt does the correct thing.

Eric

Reply via email to