What are the potential issues with using DOM in PHP when the HTML is already in UTF-8?

When using DOM in PHP with HTML that is already in UTF-8, there may be encoding conflicts if the DOM parser assumes a different encoding. To solve this issue, specify the encoding as UTF-8 when creating the DOMDocument object.

$dom = new DOMDocument('1.0', 'UTF-8');
$dom->loadHTML($html);