Description:
In our country we are using Latvian and Russian languages in addition to
English. The Eventum has encoding support for web forms (APP_CHARSET variable in
the config.inc.php file). And in our environment we have set it value to 'utf8'
But if the system generates an email (notification, etc.) then headers encoded
according the APP_CHARSET only. The responsible for body encoding headers have
invalid values:
Content-Type: text/plain; charset="ISO-8859-1"
Content-Transfer-Encoding: 7bit
We have created a small patch, and seems it working at our site. After this
patch was applied the headers changed to following values:
Content-Type: text/plain; charset="UTF-8"
Content-Transfer-Encoding: 8bit
How to repeat:
* set APP_CHARSET to utf8;
* create issue with non-latin symbols;
* read notification;
Suggested fix:
--- ./include/class.mail.php.270906 2006-03-30 22:13:13.000000000 +0300
+++ ./include/class.mail.php 2006-09-27 15:21:10.000000000 +0300
@@ -565,6 +565,8 @@
$headers = array(
'From' => $from,
'To' => Mail_API::fixAddressQuoting($to),
+ 'Content-Type' => 'text/plain; charset=UTF-8',
+ 'Content-Transfer-Encoding' => '8bit',
'Subject' => $subject
);
@@ -992,4 +994,4 @@
if (APP_BENCHMARK) {
$GLOBALS['bench']->setMarker('Included Mail_API Class');
}
--- ./include/class.notification.php.270906 2006-03-30 22:13:14.000000000 +0300
+++ ./include/class.notification.php 2006-09-27 15:23:43.000000000 +0300
@@ -355,6 +355,8 @@
// add the warning message about replies being blocked or not
$fixed_body = Mail_API::addWarningMessage($issue_id, $to, $body);
$headers['To'] = $to;
+ $headers['Content-Type'] = 'text/plain; charset=UTF-8';
+ $headers['Content-Transfer-Encoding'] = '8bit';
$mime = new Mail_mime("\r\n");
$hdrs = $mime->headers($headers);
@@ -2089,4 +2091,4 @@
if (APP_BENCHMARK) {
$GLOBALS['bench']->setMarker('Included Notification Class');
}
--- ./include/pear/Mail/mime.php.270906 2006-03-30 22:13:14.000000000 +0300
+++ ./include/pear/Mail/mime.php 2006-09-27 14:36:46.000000000 +0300
@@ -566,7 +566,7 @@
if (isset($xtra_headers)) {
$headers = array_merge($headers, $xtra_headers);
}
- $this->_headers = array_merge($headers, $this->_headers);
+ $this->_headers = array_merge($this->_headers, $headers) ;
$tmp = $this->_encodeHeaders($this->_headers);
return $tmp;