nmh-workers
[Top] [All Lists]

Re: [Nmh-workers] nmh internals: full MIME integration

2014-07-29 19:41:19

On Jul 29, 2014, at 12:47 PM, Ken Hornstein <kenh(_at_)pobox(_dot_)com> wrote:

Alright.  So ... I'm trying to understand the gain of using Bio(3).  I'm
not seeing it yet, but I'm willing to be educated.  Would you want to
import tcs(1) as well?

Bio's formatted I/O routines are fully utf-8 aware.  E.g. when looking to 
consume or output a character they know how many octets are required to form 
any given unicode character.  The upside is you never have to think at all 
about processing utf-8 -- it just happens.

Another benefit is that print() and friends let you install custom formatting 
verbs.  So you can do things like:

  int to_qp(Fmt *fmt) {/* convert data to quoted-printable */};
  fmtinstall('Q', to_qp);

and then

  char *text = "some string with non-ascii text";
  print("%Q\n", text)

and the %Q conversion formats its output as quoted-printable on the fly.  
Similarly, you could define verbs that know how to encode stuff in headers, 
escape and quote addresses as necessary, etc.  In some situations this can 
really help improve the code's readability.

--lyndon

Attachment: signature.asc
Description: Message signed with OpenPGP using GPGMail

_______________________________________________
Nmh-workers mailing list
Nmh-workers(_at_)nongnu(_dot_)org
https://lists.nongnu.org/mailman/listinfo/nmh-workers
<Prev in Thread] Current Thread [Next in Thread>