diff --git a/src/UuidBinaryModelTrait.php b/src/UuidBinaryModelTrait.php index 4630198..2bd1bbb 100644 --- a/src/UuidBinaryModelTrait.php +++ b/src/UuidBinaryModelTrait.php @@ -125,7 +125,7 @@ private function deepArray($array) elseif (is_object($value) && method_exists($value, 'toArray')) { $array[$key] = $value->toArray(); } - elseif (is_string($value) && mb_detect_encoding($value) === false) {//mb_detect_encoding will return false if $value is a binary type + elseif (is_string($value) && mb_detect_encoding($value, 'ASCII', true) === false) { // mb_detect_encoding will return false if $value is a binary type $array[$key] = $useOptimization ? self::toNormal($value) : bin2hex($value); } }