Swift_Mime_ContentEncoder_NativeQpContentEncoder::encodeString PHP Method

encodeString() public method

Encode a given string to produce an encoded string.
public encodeString ( string $string, integer $firstLineOffset, integer $maxLineLength ) : string
$string string
$firstLineOffset integer if first line needs to be shorter
$maxLineLength integer 0 indicates the default length for this encoding
return string
    public function encodeString($string, $firstLineOffset = 0, $maxLineLength = 0)
    {
        if ($this->charset !== 'utf-8') {
            throw new RuntimeException(sprintf('Charset "%s" not supported. NativeQpContentEncoder only supports "utf-8"', $this->charset));
        }
        return $this->_standardize(quoted_printable_encode($string));
    }

Usage Example

 public function testCharsetChangeNotImplemented()
 {
     $this->_encoder->charsetChanged('utf-8');
     $this->expectException(new RuntimeException('Charset "charset" not supported. NativeQpContentEncoder only supports "utf-8"'));
     $this->_encoder->charsetChanged('charset');
     $this->_encoder->encodeString('foo');
 }
All Usage Examples Of Swift_Mime_ContentEncoder_NativeQpContentEncoder::encodeString