Zend Framework

Quoted charset in MIME part Content-type header

Details

  • Type: Bug Bug
  • Status: Resolved Resolved
  • Priority: Major Major
  • Resolution: Fixed
  • Affects Version/s: None
  • Fix Version/s: 1.8.0
  • Component/s: Zend_Mime
  • Labels:
    None

Description

Hello,

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
http://tools.ietf.org/html/rfc2045#section-5.1

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

Activity

Hide
Satoru Yoshida added a comment -

Hi, Ludek.

I ensure Your report on RFC. Solved in r14837

Show
Satoru Yoshida added a comment - Hi, Ludek. I ensure Your report on RFC. Solved in r14837

People

Vote (0)
Watch (2)

Dates

  • Created:
    Updated:
    Resolved: