Unicode::strlen

public static Unicode::strlen($text) Counts the number of characters in a UTF-8 string. This is less than or equal to the byte count. Parameters string $text: The string to run the operation on. Return value int The length of the string. File core/lib/Drupal/Component/Utility/Unicode.php, line 283 Class Unicode Provides Unicode-related conversions and operations. Namespace Drupal\Component\Utility Code public static function strlen($text) { if (static::getStatus() == static::STATUS

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::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::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::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::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::mimeHeaderEncode

public static Unicode::mimeHeaderEncode($string) Encodes MIME/HTTP headers that contain incorrectly encoded characters. For example, Unicode::mimeHeaderEncode('tést.txt') returns "=?UTF-8?B?dMOpc3QudHh0?=". See http://www.rfc-editor.org/rfc/rfc2047.txt for more information. Notes: Only encode strings that contain non-ASCII characters. We progressively cut-off a chunk with self::truncateBytes(). This ensures each chunk starts and ends on a character boundary. Using \n as the chunk separator may

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::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