public function setCharset($charset)
    {
        $prev = $this->charset;

        $charset = strtoupper($charset);
        $charset = null === $charset || 'UTF-8' === $charset || 'UTF8' === $charset ? 'CP1252' : $charset;

        $this->charset = $charset;

        return $prev;
    }
public function setCharset($charset)
    {
        $prev = $this->charset;

        $charset = strtoupper($charset);
        $charset = null === $charset || 'UTF-8' === $charset || 'UTF8' === $charset ? 'CP1252' : $charset;

        $this->charset = $charset;

        return $prev;
    }
public function setCharset ( $ charset ) { $ prev = $ this -> charset ; $ charset = strtoupper ( $ charset ) ; $ charset = null === $ charset || 'UTF-8' === $ charset || 'UTF8' === $ charset ? 'CP1252' : $ charset ; $ this -> charset = $ charset ; return $ prev ; }
Sets the default character encoding to use for non-UTF8 strings.

@param string $charset The default character encoding to use for non-UTF8 strings

@return string The previous charset
Sets the default character encoding to use for non - UTF8 strings .