utf8_decode
Supported Versions: PHP 4, PHP 5, PHP 7, PHP 8
Converts a string from UTF-8 to ISO-8859-1, replacing invalid or unrepresentable characters
utf8_decode
(
string $string
):
string
laravel/framework
$uuid
=
Str
::
uuid
();
$exception
= new
Exception
(
utf8_decode
(
'ÐÑÙ0E\xE2\x�98\xA0World��7B¹!þÿ'
));
$provider
= new
DatabaseFailedJobProvider
(
$db
->
getDatabaseManager
(),
'default'
,
'failed_jobs'
);
$provider
->
log
(
'database'
,
'default'
,
json_encode
([
'uuid'
=> (string)
$uuid
]),
$exception
);
tests/Queue/DatabaseFailedJobProviderTest.php
facade/ignition
$report
=
$flareClient
->
createReport
(
$exception
);
$report
->
group
(
'bad-utf8'
, [
'name'
=>
'Marcel'
.
utf8_decode
(
'ø'
),
]);
$model
= new
ErrorPageViewModel
(
$exception
, new
IgnitionConfig
([]),
$report
, []);
tests/ErrorPageViewModelTest.php
spatie/ignition
$report
=
$flareClient
->
createReport
(
$exception
);
$report
->
group
(
'bad-utf8'
, [
'name'
=>
'JohnDoe'
.
utf8_decode
(
'ø'
),
]);
$model
= new
ErrorPageViewModel
(
$exception
, new
IgnitionConfig
([]),
$report
, []);
tests/ErrorPageViewModelTest.php