The response variable may contain binary data, making mb_substr the incorrect function to use. Pre PHP 8.3.2, mb_substr would encounter invalid UTF characters in the binary data and fall back to using substr, but from 8.3.2 on, the behavior of mb_substr has changed to replacing the invalid UTF characters with "?". This results in corrupted binary data.
The response variable may contain binary data, making mb_substr the incorrect function to use. Pre PHP 8.3.2, mb_substr would encounter invalid UTF characters in the binary data and fall back to using substr, but from 8.3.2 on, the behavior of mb_substr has changed to replacing the invalid UTF characters with "?". This results in corrupted binary data.
See issue #522