@see parent::setContentHeader()

@param $contentType
@param string $charset
@return Controller
11683
public function setContentHeader($contentType, $charset = 'UTF-8')
    {
        if (!$this->response) {
           return $this->getResponse()->setContentHeader($contentType, $charset);
        }
        return parent::setContentHeader($contentType, $charset);
    }
1355849
public function setContentPartForMimeType(Message $message, $mimeType, $stringOrHandle, $charset)
    {
        $part = ($mimeType === 'text/html') ? $message->getHtmlPart() : $message->getTextPart();
        if ($part === null) {
            $part = $this->createContentPartForMimeType($message, $mimeType, $charset);
        } else {
            $contentType = $part->getContentType();
            $part->setRawHeader('Content-Type', "$contentType;\r\n\tcharset=\"$charset\"");
        }
        $part->setContent($stringOrHandle);
    }
411203
public function setCharset($charset)
    {
        if ($this->getContentType() == '') {
            throw new Exception\RuntimeException(__METHOD__ . ' Content-type must be specified prior to setting charset');
        }
        $this->params['content-type-charset'] = $charset;

        return $this;
    }
196748
public void setContent(Object content, String contentType)
			throws UnsupportedEncodingException {
		// https://code.google.com/p/sipservlets/issues/detail?id=202
		if(getSipSession().getProxy() == null) {
			checkMessageState();
		}
		checkContentType(contentType);
		checkCommitted();

		if(contentType != null && contentType.length() > 0) {
			this.addHeader(ContentTypeHeader.NAME, contentType);
			ContentTypeHeader contentTypeHeader = (ContentTypeHeader)this.message.getHeader(ContentTypeHeader.NAME);
			String charset = this.getCharacterEncoding();
			try {
			    // https://code.google.com/p/sipservlets/issues/detail?id=169
				if(contentType.contains(CONTENT_TYPE_MULTIPART) && content instanceof Multipart) {
					// Fix for Issue 2667 : Correct Handling of MimeMultipart
					Multipart multipart = (Multipart) content;
					OutputStream os = new ByteArrayOutputStream();
					multipart.writeTo(os);
					this.message.setContent(os.toString(), contentTypeHeader);
				} else {
					Object tmpContent = content;
					if(tmpContent instanceof String  && charset != null) {
						//test for unsupportedencoding exception
						new String("testEncoding".getBytes(charset));
						tmpContent = new String(((String)tmpContent).getBytes());
					}
					this.message.setContent(content, contentTypeHeader);
				}
			} catch (UnsupportedEncodingException uee) {
				throw uee;
			} catch (Exception e) {
				throw new IllegalArgumentException("Parse error reading content " + content + " with content type " + contentType, e);
			}
		}
	}
819502
protected function _initContentType($mime, $charset)
    {
        if (!isset($this->_headers['Content-Type'])) {
            $this->mime($mime);
            $this->charset($charset);
            return;
        } elseif ($mime) {
            $this->mime($mime);
        }
        list($mime, $charset) = $this->_inspectContentType();

        $this->mime($mime);
        $this->charset($charset);
    }
583565
public static String addCharset(String charset, String contentType)
    {
        if (null == contentType)
        {
            return "text/plain;charset=" + charset;
        }
        else
        {
            Matcher matcher = CHARSET_PATT.matcher(contentType);
            if (matcher.find())
            {
                // replace what ever content-type with the charset
                return contentType.substring(0, matcher.start(1)) +
                    charset + contentType.substring(matcher.end(1));
            }
            else
            {
                return contentType + ";charset=" + charset;
            }
        }
    }
1077214
public function setBody(string $body, string $contentType = 'text/html')
    {
        $this->setHeader('Content-Type', $contentType);
        $this->body = $body;
        return $this;
    }
785534
@Override
	public void setContent(final Object content, final String type) throws MessagingException
	{
		charset = EmailExtensions.getCharsetFromContentType(type);
		super.setContent(content, type);
	}
273225
public function content($content, $contentType = self::CONTENT_TYPE_HTML, $charset = null)
    {
        $this->getSwiftMessage()->setBody($content, $contentType, $charset);

        return $this;
    }
1198523
protected A contentType(String contentType) {
        this.headers.add(Pair.of("Content-Type", contentType));
        return (A)this;
    }
90473
public function setContentType($contentType)
    {
        $this->contentType = $contentType;

        $this->setHeader('Content-Type', $contentType . '; charset=' . $this->getCharset());

        return $this;
    }
767841
public void setContentType(String contentType) throws InvalidArgumentException {
    if (Strings.isNullOrEmpty(contentType)) {
      throw new InvalidArgumentException("empty content type");
    }

    this.contentType = contentType;
  }
1178498
public function setBody($body, $contentType = null, $charset = null)
    {
        if (isset($charset)) {
            $this->setCharset($charset);
        }
        $body = $this->convertString($body);

        parent::setBody($body, $contentType);

        return $this;
    }
1071557
public function contentType($type, $set = false) {
        $content_type = self::showContentType($type);

        if ($content_type && $set) {
            $this->_response->header('Content-Type', $content_type);
        }
        return $content_type;
    }
653602
public function setContentType(ContentType $contentType)
    {
        $this->contentTypeName = $contentType->getName();
        $this->contentTypeId = null;

        return parent::setContentType($contentType);
    }
51126
public function loadFromContentType(ContentType $contentType): self
    {
        $languages = [];
        foreach ($contentType->languageCodes as $languageCode) {
            $languages[] = $this->languageService->loadLanguage($languageCode);
        }

        $this->data = array_map(
            function (Language $language) use ($contentType) {
                return $this->valueFactory->createLanguageFromContentType($language, $contentType);
            },
            $languages
        );

        return $this;
    }
1267390
public function setBody( $body, $contentType = null, $charset = null )
	{
		$this->swift->setBody( $body, $contentType, $charset );
	}