DamienHarper/auditor

UTF-8 Character Encoding fails in TransactionProcessor

joerndyherrn opened this issue · 1 comments

Q A
auditor version 2.4.3
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

see https://github.com/DamienHarper/auditor/blob/master/src/Provider/Doctrine/Auditing/Transaction/TransactionProcessor.php

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.

@joerndyherrn this is fixed in 2.4.4