I am using this to create username based on name. Name needs to be utf8 but username does not. How could I convert utf8 to non utf8?
public static function createUsername ($name, $count = 0) {
        $username = implode('.', explode(' ', strtolower($name)));
        if ($count > 0) {
            $username = $username . $count;
        }
        if (count(self::where('username', $username)->get()) > 0) {
            self::createUsername($name, $count++);
        }
        return $username;
    }
 
    