PEAR is archived and read-only

This mirror preserves historical PEAR package releases and metadata so existing references remain available.

Home » Mail » Mail_Mime » Bug #8333

Changing encode type ISO -> UTF-8

Details

Request #8333Changing encode type ISO -> UTF-8
Submitted2006-07-31 21:02 UTC
Fromjremerich at gmail dot com
Assignedcipri
StatusBogus
PackageMail_Mime
PHP Version5.1.2
OSAll
Roadmaps(Not assigned)

Comments

[2006-07-31 21:02 UTC] jremerich at gmail dot com

Description:
------------
In constructor function "Mail_mime" the variables for codification are statics. So make them be dynamic.

My language is portuguese, have acents (á, é, í, ó, ú, ç) where in ISO codification don't corretly view.

My friends and I resolving with:

function Mail_mime($crlf = "\r\n", $charset = array('html_charset'=>'ISO-8859-1', 'text_charset'=>'ISO-8859-1', 'head_charset'=>'ISO-8859-1'))

Thanks

Test script:
---------------
<?php
$body = "Este é um teste (It's test)";
$mime = new Mail_mime("\r\n", $charset);
$mime->setTXTBody($body);
$attach['encoding'] = 'base64';
$attach['data'] = "./file.xml";
$attach['type'] = "text/xml";
$attach['name'] = "file.xml";
$result = $mime->addAttachment($attach['data'], $attach['type'], $attach['name'], TRUE, $attach['encoding']);
$body = $mime->get();
$headers = $mime->headers($headers);

$mail_object =& Mail::factory('smtp', $params);
$mail_object->send($recipients, $headers, $body);
?>

Expected result:
----------------
In body e-mail:

Este é um teste (It's test)

Actual result:
--------------
Este é um teste (It's test)