public function escape($string, $charset = null) { if (is_null($charset)) { $charset = $this["charset"]; } return htmlspecialchars($string, ENT_QUOTES, $charset); }