function Mbstring::assertEncoding
4 calls to Mbstring::assertEncoding()
- Mbstring::mb_internal_trim in vendor/
symfony/ polyfill-mbstring/ Mbstring.php - Mbstring::mb_lcfirst in vendor/
symfony/ polyfill-mbstring/ Mbstring.php - Mbstring::mb_str_pad in vendor/
symfony/ polyfill-mbstring/ Mbstring.php - Mbstring::mb_ucfirst in vendor/
symfony/ polyfill-mbstring/ Mbstring.php
File
-
vendor/
symfony/ polyfill-mbstring/ Mbstring.php, line 1032
Class
- Mbstring
- Partial mbstring implementation in PHP, iconv based, UTF-8 centric.
Namespace
Symfony\Polyfill\MbstringCode
private static function assertEncoding(string $encoding, string $errorFormat) : void {
try {
$validEncoding = @self::mb_check_encoding('', $encoding);
} catch (\ValueError $e) {
throw new \ValueError(sprintf($errorFormat, $encoding));
}
// BC for PHP 7.3 and lower
if (!$validEncoding) {
throw new \ValueError(sprintf($errorFormat, $encoding));
}
}