ZF-6219: Quoted charset in MIME part Content-type header

Issue Type: Bug Created: 2009-04-06T04:42:21.000+0000 Last Updated: 2012-02-10T09:08:07.000+0000 Status: Resolved Fix version(s): - 1.8.0 (30/Apr/09)

Reporter: Ludek Stepan (ludek.stepan) Assignee: Satoru Yoshida (satoruyoshida) Tags: - Zend_Mime

Related issues: Attachments:



the character set in the Content-type header of MIME message part should not be quoted.

Content-Type: text/html; charset="utf-8"

should be replaced with:

Content-Type: text/html; charset=utf-8

As quotes are not neccessary, albeit allowed, they may cause problems to clients/MTA that do not support them correctly. All major webmail service providers are using the unquoted style, so I don't really see, why we shouldn't follow them.

RFC2045 describing the format of Content-Type header

Affected code of Zend Framework File: Zend/Mime/Part.php

<pre class="highlight">
public function getHeadersArray($EOL = Zend_Mime::LINEEND)
        $headers = array();

        $contentType = $this->type;
        if ($this->charset) {
-            $contentType .= '; charset="' . $this->charset . '"';
+            $contentType .= '; charset=' . $this->charset;

With regards, Ludek Stepan


Posted by old of Satoru Yoshida ( on 2009-04-10T16:53:10.000+0000

Hi, Ludek.

I ensure Your report on RFC. Solved in r14837

Have you found an issue?

See the Overview section for more details.


© 2006-2016 by Zend, a Rogue Wave Company. Made with by awesome contributors.

This website is built using zend-expressive and it runs on PHP 7.