twig_htmlspecialchars_decode
246 sites
Security covered
In Drupal 8 it was possible to decode HTML special characters in Twig using convert_encoding('UTF-8', 'HTML-ENTITIES') as this filter relied on mbstring extension.
However it is not possible anymore in Drupal 9 as it relies on iconv instead, and the mentioned filter throws an error:
Notice: iconv(): Wrong charset, conversion from `HTML-ENTITIES' to `UTF-8' is not allowed in twig_convert_encoding()
This module provides a new Twig filter htmlspecialchars_decode for Drupal 9 which does the same job (basically runs htmlspecialchars_decode() against the text).