We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Script getting utf8_encoding() is deprecated message in PHP 8.x, not working due to it.
function endWithJsonResponse($responseData, $filename = NULL) { if($responseData) { array_walk_recursive($responseData, function(&$value, &$key) { if(is_string($value)) $value = utf8_encode($value); }); }
Needs to be changed to something like:
function iso8859_1_to_utf8(string $s): string { $s .= $s; $len = \strlen($s); for ($i = $len >> 1, $j = 0; $i < $len; ++$i, ++$j) { switch (true) { case $s[$i] < "\x80": $s[$j] = $s[$i]; break; case $s[$i] < "\xC0": $s[$j] = "\xC2"; $s[++$j] = $s[$i]; break; default: $s[$j] = "\xC3"; $s[++$j] = \chr(\ord($s[$i]) - 64); break; } } return substr($s, 0, $j); } function endWithJsonResponse($responseData, $filename = NULL) { if($responseData) { array_walk_recursive($responseData, function(&$value, &$key) { if(is_string($value)) $value = iso8859_1_to_utf8($value); }); }
The text was updated successfully, but these errors were encountered:
No branches or pull requests
Script getting utf8_encoding() is deprecated message in PHP 8.x, not working due to it.
Needs to be changed to something like:
The text was updated successfully, but these errors were encountered: