public function setCharset(string $charset) { if ('UTF8' === ($charset = strtoupper($charset ?: ''))) { // iconv on Windows requires "UTF-8" instead of "UTF8" $charset = 'UTF-8'; } $this->charset = $charset; }