Skip to content

Commit

Permalink
Not encoding float or int
Browse files Browse the repository at this point in the history
  • Loading branch information
Stephane MEAUDRE committed Mar 25, 2024
1 parent cfadd1a commit 3f35622
Showing 1 changed file with 4 additions and 1 deletion.
5 changes: 4 additions & 1 deletion api/src/Services/DeepUtf8Encoding.php
Original file line number Diff line number Diff line change
Expand Up @@ -4,8 +4,11 @@

class DeepUtf8Encoding
{
public function __invoke(string|array|object &$input): array|object|false|string|null
public function __invoke(string|int|float|array|object &$input): array|object|false|string|null
{
if (is_int($input) || is_float($input)) {
return $input;
}
if (is_string($input)) {
$input = mb_convert_encoding($input, 'UTF-8', 'ISO-8859-1');
} else if (is_array($input)) {
Expand Down

0 comments on commit 3f35622

Please sign in to comment.