Esempio n. 1
0
 public function indexAction()
 {
     $this->_helper->viewRenderer->setNoRender();
     //$value = 'АБВГДЕЁЖЗИЙКЛМНОПРСТУФХЦЧШЩъыьЭЮЯ';
     $value = 'いろはにほへとちりぬるをわかよたれそつねならむ';
     echo "<pre>B-1. Zend_Mime::encodeBase64Header:<br>\r\n";
     echo Zend_Mime::encodeBase64Header($value, $this->_charset, $this->_len, $this->_feed);
     echo "\r\n<br><br>";
     echo "Q-1. Zend_Mime::encodeQuotedPrintableHeader:<br>\r\n";
     echo Zend_Mime::encodeQuotedPrintableHeader($value, $this->_charset, $this->_len, $this->_feed);
     echo "\r\n<br><br>";
     mb_internal_encoding($this->_charset);
     echo "B-2. Base64 by mb_encode_mimeheader:<br>\r\n";
     echo mb_encode_mimeheader($value, $this->_charset, 'B', $this->_feed, $this->_len);
     echo "\r\n<br><br>";
     echo "Q-2. QuotedPrintable by mb_encode_mimeheader:<br>\r\n";
     echo mb_encode_mimeheader($value, $this->_charset, 'Q', $this->_feed, $this->_len);
     echo "</pre>\r\n";
 }
Esempio n. 2
0
 /**
  * Encode header fields
  *
  * Encodes header content according to RFC1522 if it contains non-printable
  * characters.
  *
  * @param  string $value
  * @return string
  */
 protected function _encodeHeader($value)
 {
     if (Zend_Mime::isPrintable($value) === false) {
         if ($this->getHeaderEncoding() === Zend_Mime::ENCODING_QUOTEDPRINTABLE) {
             $value = Zend_Mime::encodeQuotedPrintableHeader($value, $this->getCharset(), Zend_Mime::LINELENGTH, Zend_Mime::LINEEND);
         } else {
             $value = Zend_Mime::encodeBase64Header($value, $this->getCharset(), Zend_Mime::LINELENGTH, Zend_Mime::LINEEND);
         }
     }
     return $value;
 }
Esempio n. 3
0
 /**
  * @group ZF-1688
  * @dataProvider dataTestEncodeMailHeaderBase64
  */
 public function testEncodeMailHeaderBase64($str, $charset, $result)
 {
     $this->assertEquals($result, Zend_Mime::encodeBase64Header($str, $charset));
 }