diff --git a/src/PasswordGenerator.php b/src/PasswordGenerator.php index 942bf38..ef24af0 100644 --- a/src/PasswordGenerator.php +++ b/src/PasswordGenerator.php @@ -30,11 +30,11 @@ public function generatePassword(int $length = 12) $all = ''; $password = ''; foreach ($sets as $set) { - $password .= $set[array_rand(str_split($set))]; + $password .= $set[array_rand(\mb_str_split($set))]; $all .= $set; } - $all = str_split($all); + $all = \mb_str_split($all); for ($i = 0; $i < $length - count($sets); $i++) { $password .= $all[array_rand($all)]; }