[dev] Email charset encode problem

Gonçalo Queirós goncalo.queiros at portugalmail.net
Tue Aug 31 16:08:47 UTC 2010


Hi there list.
I'm having an issue with email messages encoded in ISO-8859-1.
I don't know if the debug I've done is enough, but its actually a
"scary" part of the code, so here's my findings...
When i open a message with charset = ISO-8859-1 i can see it on my
computer, but not on the server. The difference is that the server ajax
request for the message preview doesn't bring the "message" part on
JSON. From my debug i found out that Horde_Serialize::_serialize has a
bit of code that only works with PHP 5.3+ (thus the problem happening on
the server and not on my pc, since the server is 5.2)

I don't know exactly what maybe wrong from all this, what i found out is
that on the same function (Horde_Serialize::_serialize) there's a call
to Horde_String::convertCharset that is being passed $params whose value
is UTF-8..but the $data is actually encoded in ISO-8859-1..Then the
json_encode call breaks because $data was not actually converted and
this error is only catched by PHP 5.3 +...

I think that the $params passed to Horde_String::convertCharset should
contain the actual charset of the message in this case no?

Sorry for not knowing exactly where the error is, but this is actually a
bit messy to debug :-)

-- 
Gonçalo Queirós
Eng. Software
*m.* 913918777

*Portugalmail* | plataformas de inovação
*w.* http://www.portugalmail.net



More information about the dev mailing list