Hello,
We recommend using PHP Tidy when transforming HTML to DOCX.
If the server doesn't allow installing PHP Tidy, setting forceNotTidy as true avoids throwing the "PHP Tidy is not available" Exception. Please note that if you set forceNotTidy to false but PHP Tidy is available, it's used internally.
If forceNotTidy is enabled and PHP Tidy is not available, phpdocx uses DOMDocument to parse the HTML (using loadHTML). In this case (and your HTML contains UTF-8 contents), you need to set UTF-8 as the content charset. You can set the content charset in the imported HTML, for example:
$docx->embedHTML('<?xml encoding="utf-8" ?><p>åäö testing chars ÅÄÖ</p>');
or transform it before it's added:
$docx->embedHTML(mb_encode_numericentity('<p>åäö testing chars ÅÄÖ</p>', [0x80, 0x10FFFF, 0, ~0], 'UTF-8'));
In both cases, please check that PHP mbstring is installed and enabled.
Regards.