$encoding = find_encoding("unicode"); $html = $encoding->decode($html);