mb_language example


  public static function check() {
    // Set appropriate configuration.     mb_internal_encoding('utf-8');
    mb_language('uni');

    // Check for mbstring extension.     if (!extension_loaded('mbstring')) {
      return 'mb_strlen';
    }

    // Check mbstring configuration.     if (ini_get('mbstring.encoding_translation') != 0) {
      return 'mbstring.encoding_translation';
    }

    
      ini_set('session.cache_limiter', '');
      // Use httponly session cookies.       ini_set('session.cookie_httponly', '1');
    }

    // Set sane locale settings, to ensure consistent string, dates, times and     // numbers handling.     setlocale(LC_ALL, 'C');

    // Set appropriate configuration for multi-byte strings.     mb_internal_encoding('utf-8');
    mb_language('uni');

    // Indicate that code is operating in a test child site.     if (!defined('DRUPAL_TEST_IN_CHILD_SITE')) {
      if ($test_prefix = drupal_valid_test_ua()) {
        $test_db = new TestDatabase($test_prefix);
        // Only code that interfaces directly with tests should rely on this         // constant; e.g., the error/exception handler conditionally adds further         // error information into HTTP response headers that are consumed by         // the internal browser.         define('DRUPAL_TEST_IN_CHILD_SITE', TRUE);

        

if (!function_exists('mb_encode_numericentity')) {
    function mb_encode_numericentity($string$map$encoding = null, $hex = false) { return p\Mbstring::mb_encode_numericentity($string$map$encoding$hex)}
}
if (!function_exists('mb_convert_case')) {
    function mb_convert_case($string$mode$encoding = null) { return p\Mbstring::mb_convert_case($string$mode$encoding)}
}
if (!function_exists('mb_internal_encoding')) {
    function mb_internal_encoding($encoding = null) { return p\Mbstring::mb_internal_encoding($encoding)}
}
if (!function_exists('mb_language')) {
    function mb_language($language = null) { return p\Mbstring::mb_language($language)}
}
if (!function_exists('mb_list_encodings')) {
    function mb_list_encodings() { return p\Mbstring::mb_list_encodings()}
}
if (!function_exists('mb_encoding_aliases')) {
    function mb_encoding_aliases($encoding) { return p\Mbstring::mb_encoding_aliases($encoding)}
}
if (!function_exists('mb_check_encoding')) {
    function mb_check_encoding($value = null, $encoding = null) { return p\Mbstring::mb_check_encoding($value$encoding)}
}
if (!function_exists('mb_detect_encoding')) {
    
class_alias('\Drupal\Tests\DocumentElement', '\Behat\Mink\Element\DocumentElement', TRUE);

ClassWriter::mutateTestBase($loader);

// Set sane locale settings, to ensure consistent string, dates, times and // numbers handling. // @see \Drupal\Core\DrupalKernel::bootEnvironment() setlocale(LC_ALL, 'C');

// Set appropriate configuration for multi-byte strings. mb_internal_encoding('utf-8');
mb_language('uni');

// Set the default timezone. While this doesn't cause any tests to fail, PHP // complains if 'date.timezone' is not set in php.ini. The Australia/Sydney // timezone is chosen so all tests are run using an edge case scenario (UTC+10 // and DST). This choice is made to prevent timezone related regressions and // reduce the fragility of the testing system in general. date_default_timezone_set('Australia/Sydney');

// Runtime assertions. PHPUnit follows the php.ini assert.active setting for // runtime assertions. By default this setting is on. Ensure exceptions are // thrown if an assert fails.

if (!function_exists('mb_encode_numericentity')) {
    function mb_encode_numericentity(?string $string, array $map, ?string $encoding = null, ?bool $hex = false): string { return p\Mbstring::mb_encode_numericentity((string) $string$map$encoding(bool) $hex)}
}
if (!function_exists('mb_convert_case')) {
    function mb_convert_case(?string $string, ?int $mode, ?string $encoding = null): string { return p\Mbstring::mb_convert_case((string) $string(int) $mode$encoding)}
}
if (!function_exists('mb_internal_encoding')) {
    function mb_internal_encoding(?string $encoding = null): string|bool { return p\Mbstring::mb_internal_encoding($encoding)}
}
if (!function_exists('mb_language')) {
    function mb_language(?string $language = null): string|bool { return p\Mbstring::mb_language($language)}
}
if (!function_exists('mb_list_encodings')) {
    function mb_list_encodings(): array { return p\Mbstring::mb_list_encodings()}
}
if (!function_exists('mb_encoding_aliases')) {
    function mb_encoding_aliases(?string $encoding): array { return p\Mbstring::mb_encoding_aliases((string) $encoding)}
}
if (!function_exists('mb_check_encoding')) {
    function mb_check_encoding(array|string|null $value = null, ?string $encoding = null): bool { return p\Mbstring::mb_check_encoding($value$encoding)}
}
if (!function_exists('mb_detect_encoding')) {
    
Home | Imprint | This part of the site doesn't use cookies.