[dev] Problem with mime parts' charsets

Jan Schneider jan@horde.org
Mon Nov 18 21:41:31 2002


MIME parts' charsets are currently either not correctly set or not correctly
read.

I found a redundancy while wading knee deep through the mime code: In
MIME_Structure::_parse() we loop through the results of
MIME_Structure::getParameters() if we have a mime part. After that
MIME_Structure::setInfo() is called that does exactly the same.

But back to the original problem. MIME_Part objects return their charsets in
MIME_Part::getCharset() by looking up $this->_charset. If it is not set, the
default charset is returned.
But _charset only gets set in MIME_Structure::setInfo() if the the returned
object from imap_fetch_structure has a charset member. I don't know if it's
local to my imap server/c-client but in my case the mime part's charset is
returned in the parameters array.

I still don't understand the mime framework well enough to work out a
correct solution, I even don't know if the error is on the set or the get
part. But perhaps this description helps someone finding a fix for this.

Jan.

--
http://www.horde.org - The Horde Project
http://www.ammma.de - discover your knowledge
http://www.tip4all.de - Deine private Tippgemeinschaft


More information about the dev mailing list