Category: php-7.4

Laravel – Json Encode Works Fine But Returns Malformed UTF-8 Error Regardless

Problem The JSON is returned correctly encoded but json_last_error equates to 5 thus Laravel throws this exception on response creation in JsonResponse->setData(). Related References A resolved bug report for symfony and PHP 7.3: https://github.com/symfony/symfony/issues/31447 mentions this exact issue. That is:…