public function setVars($key, $value, $encode = true, $charset = 'ISO-8859')
    {
        $tag= $this->config['DELIMITER_LEFT'] . $key . $this->config['DELIMITER_RIGHT'];
        if (strpos($this->contentXml, $tag) === false && strpos($this->stylesXml, $tag) === false) {
                throw new OdfException("var $key not found in the document");
        }
        $value = $encode ? $this->recursiveHtmlspecialchars($value) : $value;
        $value = ($charset == 'ISO-8859') ? utf8_encode($value) : $value;
        $this->vars[$tag] = str_replace("\n", "<text:line-break/>", $value);
        return $this;
    }