public function unicode($subject) : bool
    {
        if ($subject === null) {
            return false;
        }
        $v = '' . $subject;
        return $v === '' ? true :
            // The PHP regex u modifier forces the whole subject to be evaluated
            // as UTF-8. And if any byte sequence isn't valid UTF-8 preg_match()
            // will return zero for no-match.
            // The s modifier makes dot match newline; without it a string consisting
            // of a newline solely would result in a false negative.
            !!preg_match('/./us', $v);
    }
public function unicode($subject) : bool
    {
        if ($subject === null) {
            return false;
        }
        $v = '' . $subject;
        return $v === '' ? true :
            // The PHP regex u modifier forces the whole subject to be evaluated
            // as UTF-8. And if any byte sequence isn't valid UTF-8 preg_match()
            // will return zero for no-match.
            // The s modifier makes dot match newline; without it a string consisting
            // of a newline solely would result in a false negative.
            !!preg_match('/./us', $v);
    }
public function unicode ( $ subject ) : bool { if ( $ subject === null ) { return false ; } $ v = '' . $ subject ; return $ v === '' ? true : // The PHP regex u modifier forces the whole subject to be evaluated // as UTF-8. And if any byte sequence isn't valid UTF-8 preg_match() // will return zero for no-match. // The s modifier makes dot match newline; without it a string consisting // of a newline solely would result in a false negative. ! ! preg_match ( '/./us' , $ v ) ; }
Valid UTF-8.

NB: Returns true on empty ('') string.

@see Validate::string()

@param mixed $subject
Checked stringified.

@return bool
True on empty.
Valid UTF - 8 .