nmh-workers
[Top] [All Lists]

Re: [Nmh-workers] Thoughts: header/address parsing

2014-08-09 23:37:29
Ralph Corderoy writes:
Hi David,

2) Optionally, the user could move to the new behavior of not
   counting the trailing newline.

Like Python's `from future import sanity'.

A problem with ~/.mh_profile calling for sanity is that it might be
wanted generally but the user can't be sure no scripts they use want
insanity?

Is -width also only interested in counting bytes?  I'm UTF-8 here, but
get

    $ scan -format '%{subject}' .
    =?utf-8?Q?Po=C2=A3nds.?=
    $ 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...

-- 
Anthony J. Bentley

_______________________________________________
Nmh-workers mailing list
Nmh-workers@nongnu.org
https://lists.nongnu.org/mailman/listinfo/nmh-workers

<Prev in Thread] Current Thread [Next in Thread>