Hi Anthony,
$ for w in {0..9}; do
> echo "$w:<`scan -width $w -format '%(decode{subject})' .`>"
> done
0:<Po£nds.>
1:<>
2:<P>
3:<Po>
4:<Po�>
5:<Po£>
6:<Po£n>
7:<Po£nd>
8:<Po£nds>
9:<Po£nds.>
$
Perhaps a new -runes that counts runes/glyphs/codepoints would
sidestep the compatibility issue, -runes trumping -width?
But characters can consist of multiple codepoints (see: accents). And
characters can be double-width. Or zero-width. Or, or, or...
OK, so we're normally after columnar output. How about `-columns C',
where the string is output, as measured by wcwidth(), until either the
string ends or C would be exceeded. Then pad with ASCII space until C
is met.
Cheers, Ralph.
_______________________________________________
Nmh-workers mailing list
Nmh-workers@nongnu.org
https://lists.nongnu.org/mailman/listinfo/nmh-workers