PHP - Laravel - 格式错误的UTF-8字符,可能编码错误

I'm taking data via ADLDAP, using: https://github.com/Adldap2/Adldap2 and I have a problem with parsing an image.

enter image description here

For example, this is an taken image.

When i try to send it via AJAX Call, it returns me an error like:

enter image description here

I tried to use a specific response format, but, without success.

I've used:

  • response()->json($data, 200, array('Content-Type' => 'application/json;charset=utf8'), JSON_UNESCAPED_UNICODE),
  • json_encode($data);

You are trying to send an image as json, you have to either reference the path of the image, then populate the src attribute of an img tag, or send it as a base64 encoded image