Unicode::truncate

public static Unicode::truncate($string, $max_length, $wordsafe = FALSE, $add_ellipsis = FALSE, $min_wordsafe_length = 1) Truncates a UTF-8-encoded string safely to a number of characters. Parameters string $string: The string to truncate. int $max_length: An upper limit on the returned string length, including trailing ellipsis if $add_ellipsis is TRUE. bool $wordsafe: If TRUE, attempt to truncate on a word boundary. Word boundaries are spaces, punctuation, and Unicode characters used as word

Unicode::STATUS_MULTIBYTE

Indicates that full unicode support with the PHP mbstring extension is being used. File core/lib/Drupal/Component/Utility/Unicode.php, line 83 Class Unicode Provides Unicode-related conversions and operations. Namespace Drupal\Component\Utility Code const STATUS_MULTIBYTE = 1;

Unicode::STATUS_ERROR

Indicates an error during check for PHP unicode support. File core/lib/Drupal/Component/Utility/Unicode.php, line 88 Class Unicode Provides Unicode-related conversions and operations. Namespace Drupal\Component\Utility Code const STATUS_ERROR = -1;

Unicode::STATUS_SINGLEBYTE

Indicates that standard PHP (emulated) unicode support is being used. File core/lib/Drupal/Component/Utility/Unicode.php, line 77 Class Unicode Provides Unicode-related conversions and operations. Namespace Drupal\Component\Utility Code const STATUS_SINGLEBYTE = 0;

Unicode::setStatus

public static Unicode::setStatus($status) Sets the value for multibyte support status for the current environment. The following status keys are supported: \Drupal\Component\Utility\Unicode::STATUS_MULTIBYTE Full unicode support using an extension. \Drupal\Component\Utility\Unicode::STATUS_SINGLEBYTE Standard PHP (emulated) unicode support. \Drupal\Component\Utility\Unicode::STATUS_ERROR An error occurred. No unicode support. Parameters int $status: The new status of multibyte support. Fi

Unicode::strcasecmp

public static Unicode::strcasecmp($str1, $str2) Compares UTF-8-encoded strings in a binary safe case-insensitive manner. Parameters string $str1: The first string. string $str2: The second string. Return value int Returns < 0 if $str1 is less than $str2; > 0 if $str1 is greater than $str2, and 0 if they are equal. File core/lib/Drupal/Component/Utility/Unicode.php, line 583 Class Unicode Provides Unicode-related conversions and operations. Namespace Drupal\Component\Utility Cod

Unicode::mimeHeaderDecode

public static Unicode::mimeHeaderDecode($header) Decodes MIME/HTTP encoded header values. Parameters string $header: The header to decode. Return value string The mime-decoded header. File core/lib/Drupal/Component/Utility/Unicode.php, line 634 Class Unicode Provides Unicode-related conversions and operations. Namespace Drupal\Component\Utility Code public static function mimeHeaderDecode($header) { $callback = function($matches) { $data = ($matches[2] == 'B') ? base64_decode($

Unicode::getStatus

public static Unicode::getStatus() Gets the current status of unicode/multibyte support on this environment. Return value int The status of multibyte support. It can be one of: \Drupal\Component\Utility\Unicode::STATUS_MULTIBYTE Full unicode support using an extension. \Drupal\Component\Utility\Unicode::STATUS_SINGLEBYTE Standard PHP (emulated) unicode support. \Drupal\Component\Utility\Unicode::STATUS_ERROR An error occurred. No unicode support. File core/lib/Drupal/Component/Utility/Uni

Unicode::PREG_CLASS_WORD_BOUNDARY

Matches Unicode characters that are word boundaries. Characters with the following General_category (gc) property values are used as word boundaries. While this does not fully conform to the Word Boundaries algorithm described in http://unicode.org/reports/tr29, as PCRE does not contain the Word_Break property table, this simpler algorithm has to do. Cc, Cf, Cn, Co, Cs: Other. Pc, Pd, Pe, Pf, Pi, Po, Ps: Punctuation. Sc, Sk, Sm, So: Symbols. Zl, Zp, Zs: Separators. Non-boundary characters

Unicode::lcfirst

public static Unicode::lcfirst($text) Converts the first character of a UTF-8 string to lowercase. Parameters string $text: The string that will be converted. Return value string The string with the first character as lowercase. Related topics PHP wrapper functions Functions that are wrappers or custom implementations of PHP functions. File core/lib/Drupal/Component/Utility/Unicode.php, line 361 Class Unicode Provides Unicode-related conversions and operations. Namespace Drupal\Comp