Support for Drupal 7 is ending on 5 January 2025—it’s time to migrate to Drupal 10! Learn about the many benefits of Drupal 10 and find migration tools in our resource center.
By ParisLiakos on
Change record status:
Published (View all published change records)
Project:
Introduced in branch:
8.x
Issue links:
Description:
As of Drupal 8, most of unicode.inc functionality has been transferred to a Unicode component.
While most procedural wrappers have not be removed, they should be considered deprecated, if you want your code to be unit-testable.
Drupal 7 | Drupal 8 |
---|---|
Functions |
|
unicode_check() |
Unicode::check() |
Constants |
|
PREG_CLASS_UNICODE_WORD_BOUNDARY |
Unicode::PREG_CLASS_WORD_BOUNDARY |
UNICODE_SINGLEBYTE |
Unicode::STATUS_SINGLEBYTE |
UNICODE_MULTIBYTE |
Unicode::STATUS_MULTIBYTE |
UNICODE_ERROR |
Unicode::STATUS_ERROR |
Global variables |
|
global $multibyte |
Unicode::getStatus() | Unicode::setStatus($status) |
Functionalities |
|
drupal_convert_to_utf8() |
Unicode::convertToUtf8() |
drupal_truncate_bytes() |
Unicode::truncateBytes() |
truncate_utf8() |
Unicode::truncate() |
mime_header_encode() |
Unicode::mimeHeaderEncode() |
mime_header_decode() |
Unicode::mimeHeaderDecode() |
drupal_strlen() |
Unicode::strlen() |
drupal_strtoupper() |
Unicode::strtoupper() |
drupal_strtolower() |
Unicode::strtolower() |
drupal_ucfirst() |
Unicode::ucfirst() |
drupal_substr() |
Unicode::substr() |
drupal_validate_utf8() |
Unicode::validateUtf8() |
decode_entities() |
String::decodeEntities() |
Impacts:
Module developers
Comments
Unicode Deprecated Functions
For more information visit following link
https://api.drupal.org/api/drupal/core%21lib%21Drupal%21Component%21Util...
See also https://www.drupal
See also https://www.drupal.org/node/2457593 for a few later renames.