In order to convert my french html accents I try to change encoding by doing this in Twig :
{{ ddf.description | convert_encoding('UTF-8', 'HTML-ENTITIES') }}
But here is the message I get :
An exception has been thrown during the rendering of a template ("Notice: iconv(): Wrong charset, conversion from 'HTML-ENTITIES' to 'UTF-8' is not allowed").
Any idea ?
"HTML-ENTITIES" is not an encoding. It is a conversion function for special characters / accented encoding in (ISO ... UTF ...) to an equivalent in the same encoding or not depending on function and language.
Php htmlentities function: http://php.net/manual/en/function.htmlentities.php
Here is the html entities table: https://www.freeformatter.com/html-entities.html
Here is the list of encoding supported by iconv: how to get list of supported encodings by iconv library in php?
You can try using the "| raw" twig filter or create your own.
Unescape or html decode in Twig (PHP Templating)
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With