You are here

protected function Escaper::isUtf8 in Zircon Profile 8

Same name and namespace in other branches
  1. 8.0 vendor/zendframework/zend-escaper/src/Escaper.php \Zend\Escaper\Escaper::isUtf8()

Checks if a given string appears to be valid UTF-8 or not.

Parameters

string $string:

Return value

bool

1 call to Escaper::isUtf8()
Escaper::toUtf8 in vendor/zendframework/zend-escaper/src/Escaper.php
Converts a string to UTF-8 from the base encoding. The base encoding is set via this class' constructor.

File

vendor/zendframework/zend-escaper/src/Escaper.php, line 352

Class

Escaper
Context specific methods for use in secure output escaping

Namespace

Zend\Escaper

Code

protected function isUtf8($string) {
  return $string === '' || preg_match('/^./su', $string);
}