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



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

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


Hi, Ludek.

I ensure Your report on RFC. Solved in r14837