error: Malformed UTF-8 characters, possibly incorrectly encoded
bkhezry opened this issue · 2 comments
bkhezry commented
When I want return UUID that generated in the JSON, laravel return this error. I use utf8_encode
function like this return utf8_encode(Webpatser\Uuid\Uuid::generate());
and error fixed.
after saved UUID in the database and get it, the value is correct and did not generate error anymore.
laravel 5.5
webpatser commented
Uuid::generate() will return an object. utf8_encode expects a string.
I guess you can try return utf8_encode((string) Webpatser\Uuid\Uuid::generate());
bkhezry commented
this is my mistake. thanks for your quick reply.