You are here

protected function SingleAssetOptimizerBase::stringContainsMultibyteCharacters in Advanced CSS/JS Aggregation 8.4

Same name and namespace in other branches
  1. 8.3 src/Asset/SingleAssetOptimizerBase.php \Drupal\advagg\Asset\SingleAssetOptimizerBase::stringContainsMultibyteCharacters()

Checks if string contains multibyte characters.

Parameters

string $string: String to check.

Return value

bool TRUE if string contains multibyte character.

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

File

src/Asset/SingleAssetOptimizerBase.php, line 75

Class

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;
}