Problem/Motivation
We utilize a htmlspecialchars_decode(iconv()) which helps encode our text, however there are certain edge cases where:
$dom->loadHTML(htmlspecialchars_decode(iconv('UTF-8', 'ISO-8859-1', htmlentities($text, ENT_COMPAT, 'UTF-8')), ENT_QUOTES));
could result in data loss if there are encoding mismatches when using functions like iconv.
Proposed resolution
It looks like for PHP 8.2 the accepted solution for this is leveraging:
$dom->loadHTML(mb_encode_numericentity($text, [0x80, 0x10FFFF, 0, ~0], 'UTF-8'));
Let's switch it to use that instead.
Issue fork augmentor_azure_openai-3461795
Show commands
Start within a Git clone of the project using the version control instructions.
Or, if you do not have SSH keys set up on git.drupalcode.org:
Comments
Comment #3
j-barnes commentedComment #5
j-barnes commentedComment #6
j-barnes commented