DamienHarper/auditor-bundle

UTF-8 Character Encoding fails in TransactionProcessor

Closed this issue · 1 comments

Q A
auditor-bundle version 5.2.1
PHP version PHP 7.4.33 (cli) (built: Nov 6 2022 16:45:55) ( NTS )
Database MySQL

Summary

We sometimes get an error during data crawling that utf-8 characters are possibly incorrectly encoded

Current behavior

We get the following exception:

JsonException: Malformed UTF-8 characters, possibly incorrectly encoded in /var/www/symfony/vendor/damienharper/auditor/src/Provider/Doctrine/Auditing/Transaction/TransactionProcessor.php:222

How to reproduce

It seems that this exception may relate to the following solution: https://stackoverflow.com/a/52641198/11957237 using mb_convert_encoding

Expected behavior

The auditor should not crash and rather log a warning or format the data properly.

Sorry, wrong project and created new one DamienHarper/auditor#150