TYPO3  7.6
QpHeaderEncoder.php
Go to the documentation of this file.
1 <?php
2 
3 /*
4  * This file is part of SwiftMailer.
5  * (c) 2004-2009 Chris Corbyn
6  *
7  * For the full copyright and license information, please view the LICENSE
8  * file that was distributed with this source code.
9  */
10 
17 {
23  public function __construct(Swift_CharacterStream $charStream)
24  {
25  parent::__construct($charStream);
26  }
27 
28  protected function initSafeMap()
29  {
30  foreach (array_merge(
31  range(0x61, 0x7A), range(0x41, 0x5A),
32  range(0x30, 0x39), array(0x20, 0x21, 0x2A, 0x2B, 0x2D, 0x2F)
33  ) as $byte) {
34  $this->_safeMap[$byte] = chr($byte);
35  }
36  }
37 
45  public function getName()
46  {
47  return 'Q';
48  }
49 
59  public function encodeString($string, $firstLineOffset = 0, $maxLineLength = 0)
60  {
61  return str_replace(array(' ', '=20', "=\r\n"), array('_', '_', "\r\n"),
62  parent::encodeString($string, $firstLineOffset, $maxLineLength)
63  );
64  }
65 }