nmh-workers
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

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


From: Lyndon Nerenberg
Subject: Re: [Nmh-workers] nmh internals: full MIME integration
Date: Tue, 29 Jul 2014 17:40:56 -0700

On Jul 29, 2014, at 12:47 PM, Ken Hornstein <address@hidden> 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


reply via email to

[Prev in Thread] Current Thread [Next in Thread]