public static function toUnderscore($string)
    {
        if (!is_string($string)) {
            throw new \InvalidArgumentException('Not a string');
        }

        $transCoder = Transcoder::create('ASCII');
        $string = $transCoder->transcode(trim($string));
        $words = explode(' ', $string);

        return implode('_', array_filter(array_map([static::class, 'wordToUnderscored'], $words)));
    }