Skip to main content
Drupal API
User account menu
  • Log in

Breadcrumb

  1. Drupal Core 11.1.x
  2. Mbstring.php

function Mbstring::mb_check_encoding

1 call to Mbstring::mb_check_encoding()
Mbstring::assertEncoding in vendor/symfony/polyfill-mbstring/Mbstring.php

File

vendor/symfony/polyfill-mbstring/Mbstring.php, line 425

Class

Mbstring
Partial mbstring implementation in PHP, iconv based, UTF-8 centric.

Namespace

Symfony\Polyfill\Mbstring

Code

public static function mb_check_encoding($var = null, $encoding = null) {
    if (null === $encoding) {
        if (null === $var) {
            return false;
        }
        $encoding = self::$internalEncoding;
    }
    if (!\is_array($var)) {
        return self::mb_detect_encoding($var, [
            $encoding,
        ]) || false !== @iconv($encoding, $encoding, $var);
    }
    foreach ($var as $key => $value) {
        if (!self::mb_check_encoding($key, $encoding)) {
            return false;
        }
        if (!self::mb_check_encoding($value, $encoding)) {
            return false;
        }
    }
    return true;
}

API Navigation

  • Drupal Core 11.1.x
  • Topics
  • Classes
  • Functions
  • Constants
  • Globals
  • Files
  • Namespaces
  • Deprecated
  • Services
RSS feed
Powered by Drupal