[ BTW, Tim followed-up to a message from another mailing list
  (mimelib-devel) which is why you didn't see its parent.  See
  http://article.gmane.org/gmane.comp.python.mime.devel/280 for
  that thread ]

Tim Legant <[EMAIL PROTECTED]> writes:

> What about something weird like this (this is the template):
>
>     From.US-ASCII: "%(FULLNAME)s" <%(recipient_address)s>
>     Subject.EUC-JP: Please confirm your message
>     Charset: EUC-JP
>
> So, if you want to encode the header, you append '.<charset>' to the
> header name.  If you want to leave it in ASCII, just leave the
> header plain.  The Charset pseudo-header affects the body, as
> before.

I think this will work.  Do you think the default templates should
append .US-ASCII to From and Subject to indicate the default charset?
The reason I'm learning towards this is that it gives a clear
indication that the default charset is US-ASCII and alludes to the
fact that one can change it.  

If the .US-ASCII is left off, users may be more inclined to input the
non-US_ASCII text without changing the charset suffix.

> Or rather, I think it works, if there's a way to verify that the
> charset specified is valid.  Perhaps just attempting to encode the
> header with that charset and catching any exceptions is good enough.

Yup, a LookupError is raised if this is attempted, so I don't think we
need to explicitly do any lookups before the encoding attempt.
_________________________________________________
tmda-workers mailing list ([EMAIL PROTECTED])
http://tmda.net/lists/listinfo/tmda-workers

Reply via email to