Change record status: 
Project: 
Introduced in branch: 
8.6.x
Description: 

Drupal 8 ships with Symfony's mbstring polyfill which makes some methods in \Drupal\Component\Utility\Unicode obsolete.

Replace \Drupal\Component\Utility\Unicode::strlen() with mb_strlen()
Replace \Drupal\Component\Utility\Unicode::strtoupper() with mb_strtoupper()
Replace \Drupal\Component\Utility\Unicode::strtolower() with mb_strtolower()
Replace \Drupal\Component\Utility\Unicode::substr() with mb_substr()
Replace \Drupal\Component\Utility\Unicode::strpos() with mb_strpos()

\Drupal\Component\Utility\Unicode::setStatus() is deprecated and will be removed in Drupal 9. In Drupal 8 it's primary purpose was for testing. Since Symfony's polyfill is available it is a pointless method.

Impacts: 
Module developers
Themers

Comments

jweowu’s picture

D7: drupal_convert_to_utf8()   D8: mb_convert_encoding()
D7: drupal_truncate_bytes()    D8: mb_strcut()
D7: drupal_strlen()            D8: mb_strlen()
D7: drupal_strtolower()        D8: mb_strtolower()
D7: drupal_substr()            D8: mb_substr()