mhonarc-dev

Re: Charset

2005-08-01 13:18:59
On August 1, 2005 at 11:29, East Coast Coder wrote:

What is the best way, form within a callback, to determine the charset?

Have a look at the readmail::extract_charset() routine.

Note, you may need to take into account the TEXTENCODE resource.
If enabled, all character data will be converted according to
the value of this resource.

MIMEFILTERS filters are actually provided the effecting charset.
For API callbacks, you will need to use readmail::extract_charset()
directly and check TEXTENCODE.

TEXTENCODE makes this easier since you can normalize all character
data to a single encoding (like UTF-8).  You should consider this if
you want to avoid charset soup.

And (this is a MIME question) - are the subject/from/other headers
assumed to be
ascii 7 bit, or can they also be in charsets?  How should this be handled bes
t?

Mail standards state that mail header data must only be 7-bit ASCII,
but not all systems honor this.  MHonArc deals with it via the
DEFCHARSET resource (along with CHARSETALIASES and CHARSETCONVERTERS).

MIME also allows the encoding on non-ASCII data in headers, so depending
on what you are trying to do, the "rendered" version of a header
may be in multiple encodings even though the raw version is in ASCII.

--ewh

---------------------------------------------------------------------
To sign-off this list, send email to majordomo(_at_)mhonarc(_dot_)org with the
message text UNSUBSCRIBE MHONARC-DEV

<Prev in Thread] Current Thread [Next in Thread>
  • Charset, East Coast Coder
    • Re: Charset, Earl Hood <=