Exemplo n.º 1
0
 /**
  * @return string
  */
 public function EncodedValue()
 {
     $sResult = $this->sFullValue;
     if ($this->IsSubject()) {
         if (!\MailSo\Base\Utils::IsAscii($sResult) && \MailSo\Base\Utils::IsIconvSupported() && \function_exists('iconv_mime_encode')) {
             $aPreferences = array('scheme' => \MailSo\Base\Enumerations\Encoding::BASE64_SHORT, 'input-charset' => \MailSo\Base\Enumerations\Charset::UTF_8, 'output-charset' => \MailSo\Base\Enumerations\Charset::UTF_8, 'line-length' => \MailSo\Mime\Enumerations\Constants::LINE_LENGTH, 'line-break-chars' => \MailSo\Mime\Enumerations\Constants::CRLF);
             return \iconv_mime_encode($this->Name(), $sResult, $aPreferences);
         }
     } else {
         if ($this->IsParameterized() && $this->oParameters && 0 < $this->oParameters->Count()) {
             $sResult = $this->sValue . '; ' . $this->oParameters->ToString(true);
         } else {
             if ($this->IsEmail()) {
                 $oEmailCollection = \MailSo\Mime\EmailCollection::NewInstance($this->sFullValue);
                 if ($oEmailCollection && 0 < $oEmailCollection->Count()) {
                     $sResult = $oEmailCollection->ToString(true, false);
                 }
             }
         }
     }
     return $this->NameWithDelimitrom() . $this->wordWrapHelper($sResult);
 }