Render plain text into the given content.

@param string &$content
@param string $text
@param string $encoding
@param string $boundary
512652
private function renderPlainText(&$content, $text, $encoding, $boundary)
    {
        $content .= "\r\n";
        $content .= "--$boundary\r\n";
        $content .= "Content-Type: text/plain;\r\n\tcharset=\"$encoding\"\r\n";
        $content .= "Content-Transfer-Encoding: quoted-printable\r\n";
        $content .= "\r\n";
        $content .= "$text\r\n";
    }
1006650
private static function encodeBoundaryBlock($boundary, $contentType, $charset, $encoding, $content, $eol = "\n") {
		return '--' . $boundary . $eol
			. 'Content-Type: ' . $contentType. '; charset="' . $charset . '"' . $eol
			. 'Content-Transfer-Encoding: ' . $encoding . $eol . $eol 
			. self::encodeString($content, $encoding, $eol)
			. $eol . $eol;
	}
482890
private final void renderContentTemplate(final ST contentTemplate, final Writer writer, final Map<String, Object> values/*, final String language*/, final ErrorBuffer error) {
        injectTemplateValues(contentTemplate, values);
//        if (language == null)
            contentTemplate.write(createSTWriter(writer), error);
//        else
//            contentTemplate.write(createSTWriter(writer), new Locale(language), error);
    }
608773
public void setUtf8Content(final Object content) throws MessagingException
	{
		final String type = EmailConstants.MIMETYPE_TEXT_PLAIN + EmailConstants.CHARSET_PREFIX
			+ EmailConstants.CHARSET_UTF8;
		setContent(content, type);
	}
1254307
public function createBlob(string $content, string $encoding = 'utf-8'): array
    {
        return $this->getApi()->request($this->getApi()
                                             ->sprintf('/repos/:owner/:repo/git/blobs', $this->getGitData()->getOwner(),
                                                 $this->getGitData()->getRepo()), Request::METHOD_POST, [
                'content'  => $content,
                'encoding' => $encoding
            ]);
    }
419360
public function render(Content $content, $parameters)
    {
        return $this->markdownParser->transformMarkdown($this->getFileContent($content));
    }
399078
public function setBodyHtml($html, $charset = null, $encoding = Zend_Mime::ENCODING_QUOTEDPRINTABLE)
    {
        if ($charset === null) {
            $charset = $this->_charset;
        }

        $mp = new Zend_Mime_Part($html);
        $mp->encoding = $encoding;
        $mp->type = Zend_Mime::TYPE_HTML;
        $mp->disposition = Zend_Mime::DISPOSITION_INLINE;
        $mp->charset = $charset;

        $this->_bodyHtml = $mp;

        return $this;
    }
543502
protected function GetBoundary($boundary, $charSet, $contentType, $encoding)
    {
        $result = '';
        if ($charSet == '') {
            $charSet = $this->CharSet;
        }
        if ($contentType == '') {
            $contentType = $this->ContentType;
        }
        if ($encoding == '') {
            $encoding = $this->Encoding;
        }
        $result .= $this->TextLine('--' . $boundary);
        $result .= sprintf("Content-Type: %s; charset=\"%s\"", $contentType, $charSet);
        $result .= $this->LE;
        $result .= $this->HeaderLine('Content-Transfer-Encoding', $encoding);
        $result .= $this->LE;

        return $result;
    }
556333
public void stringToOutputStream(String content, OutputStream out) throws IOException {
        out.write(content.getBytes());
        out.close();
    }
307872
public function add(string $content, string $mimeType = null, $encoding = null): void
    {
        $contentPart = $this->make();
        $contentPart->content = $content;
        if ($mimeType !== null) {
            $contentPart->mimeType = $mimeType;
        }
        if ($encoding !== null) {
            $contentPart->encoding = $encoding;
        }
        $this->set($contentPart);
    }
1206718
public function parseBoundary($content, $boundary)
    {
        $content = str_replace("\r", '', $content); // acceptable

        $this->content = $content;
        $this->cursor  = 0;

        try {
            return $this->doParseBoundary($boundary);
        } catch (\Exception $e) {
            $text = substr($this->content, $this->cursor, 10);

            throw new \InvalidArgumentException(sprintf('Error while parsing "%s" (cursor: %d, text: "%s").'."\n%s", $e->getMessage(), $this->cursor, $text, $e->getTraceAsString()));
        }
    }
264756
public static function wrapOnDemand($condition, $tag, $content)
    {
        if ($condition) {
            echo sprintf('<%s>%s</%s>', $tag, $content, $tag);
        } else {
            echo $content;
        }
    }
207048
public void setContentEncoding(String encoding) {
        if (encoding == null) {
            _properties.remove(AMQP_PROP_CONTENT_ENCODING);
            return;
        }
        
        _properties.put(AMQP_PROP_CONTENT_ENCODING, encoding);
    }
323366
public function full_tag($tag, $content = null, $attributes = null) {
        $content = $this->text_content($content); // First of all, apply transformations
        $this->nullcontent = is_null($content) ? true : false; // Is it null content
        $this->begin_tag($tag, $attributes);
        if (!$this->nullcontent) {
            $this->write($content);
            $this->lastwastext = true;
            $this->end_tag($tag);
        }
    }
82517
protected function _sendHtmlBody($htmlBody, $boundary = null)
    {
        $contentType = preg_match('#<meta http-equiv="Content-Type" content="([^"]+)">#i', $htmlBody, $match) ? $match[1] : 'text/html; charset=utf-8';

        if ($boundary) {
            $this->_writeLine();
            $this->_writeLine("--$boundary");
        }
        $this->_writeLine('Content-Type: ' . $contentType);
        $this->_writeLine('Content-Length: ' . strlen($htmlBody));
        $this->_writeLine('Content-Transfer-Encoding: base64');
        $this->_writeLine();
        $this->_writeLine(chunk_split(base64_encode($htmlBody), 983));

        return $this;
    }
1117008
private function  sendContentString($content = '', Request $request)
    {
        $response = $request->getResponse();
        $response->setContent($content);
        $response->send();
    }
816556
public function writeFile(
        string $content,
        string $filename,
        string $encoding = Encoder::DEFAULT_BYTE_MODE_ECODING,
        ?ErrorCorrectionLevel $ecLevel = null
    ) : void {
        file_put_contents($filename, $this->writeString($content, $encoding, $ecLevel));
    }