function prepareHtml() {
        // remove all tabs and new lines - as they mean nothing in HTML
        $this->html = trim(preg_replace('/\t\n/', '', $this->html));

        // normalize multiple spaces to one space
        $this->html = preg_replace('/\s+/', ' ', $this->html);

        // replace special characters like &nbsp;
        $this->html = $this->replaceSpecialCharacters($this->html);

//        $charset = 'UTF-8';
//        if (function_exists('mb_convert_encoding') && in_array(strtolower($charset), array_map('strtolower', mb_list_encodings()))) {
//            $this->html = mb_convert_encoding($this->html, 'HTML-ENTITIES', $charset);
//        }

    }