We are using a variable like this, to render the text without special characters like HELP & SUPPORT
,
{{ variable|render|striptags|trim|convert_encoding('UTF-8', 'HTML-ENTITIES') }}
After upgrading from Drupal 8 to 9, we are getting errors like,
Notice: iconv(): Wrong charset, conversion from
HTML-ENTITIES' to
UTF-8' is not allowed in twig_convert_encoding() (line 1009 of /var/www/html/stg.flowbusiness.co/vendor/twig/twig/src/Extension/CoreExtension.php)
And the variable is not displaying with convert_encoding function.
So, any suggestions to display the text without special characters in drupal 9.