Set the response charset.

@param string $charset Charset name.

@return $this
771354
public function setCharset($charset)
    {
        $this->charset = $charset;
        $this->setContentType($this->getContentType()); // update charset which is set on content-type

        return $this;
    }
620485
public void setEncoding(String charset) {
    Validator.validate(!Validator.isBlank(charset), "encoding cannot be blank");
    this.encoding = charset.trim();
  }
1340240
public function setCharset($charset)
    {
        $this->charset = $charset;
        $this->factory->charsetChanged($charset);
        $this->notifyHeadersOfCharset($charset);
    }
876084
protected function setCharsets()
    {
        if ((count($this->charsets) === 0) && ! empty($_SERVER[ 'HTTP_ACCEPT_CHARSET' ])) {
            $this->charsets = explode(
                ',',
                preg_replace(
                    '/(;\s?q=.+)|\s/i',
                    '',
                    strtolower(trim($_SERVER[ 'HTTP_ACCEPT_CHARSET' ]))
                )
            );
        }

        if (count($this->charsets) === 0) {
            $this->charsets = ['Undefined'];
        }
    }
698542
public function setCharset($charset)
    {
        $this->setHeaderParameter('Content-Type', 'charset', $charset);
        if ($charset !== $this->userCharset) {
            $this->clearCache();
        }
        $this->userCharset = $charset;
        parent::charsetChanged($charset);

        return $this;
    }
1253552
public function charset($charset = null)
    {
        deprecationWarning('Email::charset() is deprecated. Use Email::setCharset() or Email::getCharset() instead.');

        if ($charset === null) {
            return $this->getCharset();
        }
        $this->setCharset($charset);

        return $this->charset;
    }
738723
public InterfaceConfigBuilder setMethodsCharset(Charset charset) {
        for (MethodConfigBuilder b : methodBuilders.values()) {
            b.setCharset(charset);
        }
        return this;
    }
472919
public function charset($charset = null)
    {
        if (!func_num_args()) {
            return $this->_stream->charset();
        }
        $this->_stream->charset($charset);
        return $this;
    }
273596
public Charset setCharset(Charset charset) {
        Charset prev = this.charset.get();
        this.charset.set(charset);
        return prev;
    }
951053
function initPHP( $charset = false )
    {
        if ( $charset === false )
            $charset = $this->Language->code();
        setlocale( LC_ALL, $charset );
    }
913371
public function setOutputCharset($charset)
    {
        $flag = true;
        
        $charset  = strtolower($charset);
        $charsets = array('utf-8', 'windows-1256', 'cp1256', 'iso-8859-6');
        
        if (in_array($charset, $charsets)) {
            if ($charset == 'windows-1256') {
                $charset = 'cp1256';
            }
            $this->_outputCharset = $charset;
        } else {
            $flag = false;
        }
        
        return $flag;
    }
993972
public function headerCharset($charset = null)
    {
        deprecationWarning('Email::headerCharset() is deprecated. Use Email::setHeaderCharset() or Email::getHeaderCharset() instead.');

        if ($charset === null) {
            return $this->getHeaderCharset();
        }

        $this->setHeaderCharset($charset);

        return $this->headerCharset;
    }
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;
    }
738631
public function setCharset($charset)
    {
        if (is_string($charset)) {
            if (in_array($charset, mb_list_encodings())) {
                $this->charset = $charset;
            } else {
                throw new \InvalidArgumentException(
                    "Invalid value '" . $charset . "' for argument 'charset' given. Charset not supported."
                );
            }
        } else {
            throw new \InvalidArgumentException(
                "Invalid type '" . gettype($charset). "' for argument 'charset' given."
            );
        }

        return $this;
    }
359391
public void setCharset(final String charset) {
		try {
			this.charset = Charset.forName(charset);
		} catch (UnsupportedCharsetException ex) {
			this.charset = StandardCharsets.UTF_8;
			LOG.error("The specified character set could not be converted to {}. Set the default character set({}).",
					charset, this.charset);
		}
	}
552753
public function setCharset($charset = null)
    {
        if (! is_null($charset)) {
            $this->charset = $charset;
        } elseif (defined('THEMOSIS_CHARSET')) {
            $this->charset = THEMOSIS_CHARSET;
        } elseif (function_exists('get_bloginfo')) {
            $this->charset = get_bloginfo('charset');
        }

        return $this;
    }
816955
function isAllowedCharset( $charset )
    {
        $realCharset = eZCharsetInfo::realCharsetCode( $charset );
        $charsets = $this->allowedCharsets();
        foreach ( $charsets as $charsetName )
        {
            $realName = eZCharsetInfo::realCharsetCode( $charsetName );
            if ( $realName == $realCharset )
                return true;
        }
        return false;
    }