List Info

Thread: Fwd: E-mail in ISO-8859-1 format




Fwd: E-mail in ISO-8859-1 format
user name
2007-06-05 13:25:44
2007/6/5, Bryan Alsdorf bryanmysql.com:

>
> On the bottom of view_email.php Eventum checks the
charset of the email
> and tried to display the page that way. That is where I
would start
> looking.



Hi Bryan,

I started there, as you said.
I discovered that this function is returning empty, and so,
doesn't set the
right charset.:

$charset =
Mime_Helper::getCharacterSet($email['seb_full_email']);
if (!empty($charset)) {
    header("Content-Type: text/html; charset=" .
$charset);
}



The function below is the getCharacterSet called above.
In my machine, when it receives a ISO-8859-1 charset
message, it enters the
first conditional, executes the Mime_Helper::decode, and
then leave on the
second conditional, the $structure is empty.

I don't know where this $structure should be set value.

Anyone has suggestions?


    /**
     * Method used to get charset from raw email.
     *
     * access  public
     * param   mixed   $input The full body of the message
or decoded
email.
     * return  string charset extracted from Content-Type
header of email.
     */
    function getCharacterSet($input)
    {
        if (!is_object($input)) {
            $input = Mime_Helper::decode($input, false,
false);
        } else {
            $structure = $input;
        }

        if (empty($structure)) {
            return false;
        }

        if ($structure->ctype_primary == 'multipart' and
$structure->ctype_secondary == 'mixed'
            and count($structure->parts) >= 1 and
$structure->parts[0]->ctype_primary == 'text') {
            $content_type =
$structure->parts[0]->headers['content-type'];
        } else {
            $content_type = $structure->headers['content-type'];
        }

        if
(preg_match('/charsets*=s*(["'])?([-wd]+)(1)?;?/i
',
$content_type, $matches)) {
            return $matches[2];
        }

        return false;
    }


[]s
Gutemberg Vieira
Re: Fwd: E-mail in ISO-8859-1 format
user name
2007-06-12 07:29:29
On Tuesday 05 June 2007 21:25:44 Gutemberg Vieira wrote:
> I don't know where this $structure should be set
value.

it's fixed in svn

-- 
glen

-- 
Eventum Developers Mailing List
For list archives: http://lists.mys
ql.com/eventum-devel
To unsubscribe:    http:
//lists.mysql.com/eventum-devel?unsub=bondyahoo.com


Re: Fwd: E-mail in ISO-8859-1 format
user name
2007-06-12 07:29:29
On Tuesday 05 June 2007 21:25:44 Gutemberg Vieira wrote:
> I don't know where this $structure should be set
value.

it's fixed in svn

-- 
glen

-- 
Eventum Developers Mailing List
For list archives: http://lists.mys
ql.com/eventum-devel
To unsubscribe:    htt
p://lists.mysql.com/eventum-devel?unsub=nesstosharedlog.com


[1-3]

about | contact  Other archives ( Real Estate discussion Medical topics )