Unicode::convertToUtf8

public static Unicode::convertToUtf8($data, $encoding) Converts data to UTF-8. Requires the iconv, GNU recode or mbstring PHP extension. Parameters string $data: The data to be converted. string $encoding: The encoding that the data is in. Return value string|bool Converted data or FALSE. File core/lib/Drupal/Component/Utility/Unicode.php, line 226 Class Unicode Provides Unicode-related conversions and operations. Namespace Drupal\Component\Utility Code public static function convert

Unicode::encodingFromBOM

public static Unicode::encodingFromBOM($data) Decodes UTF byte-order mark (BOM) into the encoding's name. Parameters string $data: The data possibly containing a BOM. This can be the entire contents of a file, or just a fragment containing at least the first five bytes. Return value string|bool The name of the encoding, or FALSE if no byte order mark was present. File core/lib/Drupal/Component/Utility/Unicode.php, line 191 Class Unicode Provides Unicode-related conversions and operations

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

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