I wrote: > $ echo '\[-+]' | nroff | grep . > ∓ > $ echo '\[-+]' | nroff -Tascii | grep . > -+ > $ echo '\[-+]' | nroff -Tiso-8859-1 | grep . > ∓ > $
I made a mistake with `nroff -Tiso-8859-1'; that's not a valid -T value. nroff(1) says If neither the GROFF_TYPESETTER environment variable nor the -T command line option (which overrides the environment variable) specifies a (valid) device, nroff checks the current locale to select a default output device. Why is it useful to have nroff ignore a duff -T value and fall back as if it was unspecified? Switching to the valid equivalent(?): $ echo '\[-+]' | nroff -Tlatin1 | grep . -+ $ latin1(7) here says Oct Dec Hex Char Description ─────────────────────────────────────────── ... 261 177 B1 ± PLUS-MINUS SIGN and that seems defined in the device's fonts $ fgrep +- font/devlatin1/R +- 24 0 0261 t+- " $ so why isn't grotty outputing the single byte for it? > I'm guessing it's to do with the type of output you're producing. As Carsten's said. $ echo '\[-+]' | groff >/dev/null <standard input>:1: warning: can't find special character `-+' $ The PostScript glyph name is `plusminus'. $ curl -sS http://partners.adobe.com/public/developer/en/opentype/glyphlist.txt | > grep plusminus plusminus;00B1 $ It's used in the Times Roman font definition. $ grep plusminus font/devps/TR t+- 564,506 0 177 plusminus $ But for some reason, it's called `t+-'. Using that works, with the appropriate single byte being printed. $ echo '\[t+-]' | groff | grep /F0 /F0 10/Times-Roman@0 SF<b1>72 12 Q 0 Cg EP $ echo $((0xb1)) 177 $ Why it's not known as \[+-] too, I don't know. So, I haven't answered the "whys". Someone else can, I'm sure. :-) Cheers, Ralph.