Same name in other branches
  1. 5.0.x src/Asset/SingleAssetOptimizerBase.php \Drupal\advagg\Asset\SingleAssetOptimizerBase::stringContainsMultibyteCharacters()
  2. 6.0.x src/Asset/SingleAssetOptimizerBase.php \Drupal\advagg\Asset\SingleAssetOptimizerBase::stringContainsMultibyteCharacters()
  3. 8.x-3.x src/Asset/SingleAssetOptimizerBase.php \Drupal\advagg\Asset\SingleAssetOptimizerBase::stringContainsMultibyteCharacters()

Checks if string contains multibyte characters.

Paramètres

string $string: String to check.

Return value

bool TRUE if string contains multibyte character.

1 call to SingleAssetOptimizerBase::stringContainsMultibyteCharacters()
JsMinifier::minifyJsmin dans advagg_js_minify/src/Asset/JsMinifier.php
Minify a JS string using jsmin.

Fichier

src/Asset/SingleAssetOptimizerBase.php, line 75

Classe

SingleAssetOptimizerBase
A base class for optimizing (especially minifying) assets.

Namespace

Drupal\advagg\Asset

Code

protected function stringContainsMultibyteCharacters($string) {
    // Check if there are multi-byte characters: If the UTF-8 encoded string has
    // multibyte chars strlen() will return a byte-count greater than the actual
    // character count, returned by drupal_strlen().
    if (strlen($string) === mb_strlen($string)) {
        return FALSE;
    }
    return TRUE;
}