TYPO3  7.6
Base64HeaderEncoder.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 {
24  public function getName()
25  {
26  return 'B';
27  }
28 
42  public function encodeString($string, $firstLineOffset = 0, $maxLineLength = 0, $charset = 'utf-8')
43  {
44  if (strtolower($charset) === 'iso-2022-jp') {
45  $old = mb_internal_encoding();
46  mb_internal_encoding('utf-8');
47  $newstring = mb_encode_mimeheader($string, $charset, $this->getName(), "\r\n");
48  mb_internal_encoding($old);
49 
50  return $newstring;
51  }
52 
53  return parent::encodeString($string, $firstLineOffset, $maxLineLength);
54  }
55 }