Код: Выделить всё
"message": "Malformed UTF-8 characters, possibly incorrectly encoded",
Код: Выделить всё
944CC79D-5980-4587-8A52-000A2F11D7D1Код: Выделить всё
b"ØÃLöÇYçEèR\0\n/\x11ÎÐ"моя среда:
- mac os, tahoe 26.1 ver
- php 8.4 отредактировано: я понизил версию до php 8.2, но uuid все равно неверный.
- laravel 11
- БД с использованием сервера sql
Я хочу, чтобы uuid был передан правильно. не b"ØÃLöÇYçEèR\0\n/\x11ÎÐ"
редактировать:
вот консоль php artisan
просто и обычно. судя по всему, все uuid стали деформированными. не только для пользователей
Код: Выделить всё
php artisan tinker
Psy Shell v0.12.7 (PHP 8.2.29 — cli) by Justin Hileman
> User::first()
[!] Aliasing 'User' to 'App\Models\User' for this Tinker session.
= App\Models\User {#6624
id: b"ØÃLöÇYçEèR\0\n/\x11ÎÐ",
//rest of the data
Код: Выделить всё
The root cause is most likely due to the difference in default encoding between Windows and macOS.
On Windows, many files, input, and CLI data are stored in ANSI/Windows-1252, while on macOS, the default encoding is UTF-8.
When Laravel on Mac tries to encode JSON, it encounters data that is still in Windows-1252 or ISO-8859 format and immediately throws an error:
Malformed UTF-8 characters, possibly incorrectly encoded
On Windows, there's no error because PHP on Windows automatically accepts Windows-1252, which is more permissive.
Заранее спасибо.
Подробнее здесь: https://stackoverflow.com/questions/798 ... ver-on-mac
Мобильная версия