Impossible to html_entity_decode the button title in a render array Here is the code that reside in my extended class of the RegisterForm:

$title=$this-&gt;t("M'inscrire") // notice the apostrophe in French
// the $element variable is the action sub array of the form
$element['submit']['#value'] = html_entity_decode($title, ENT_QUOTES, 'UTF-8');
dpm(html_entity_decode($title, ENT_QUOTES, 'UTF-8'));


Unfortunately, my submit button is displayed like M&amp;#039inscrire
And strangely, the dpm function print it as it should be

Edit to add, the following does not work:

$element['submit']['#value'] = $this-&gt;t("M'inscrire"); //NOT WORKING
$element['submit']['#value'] = "M'inscrire"; //NOT WORKING
As pointed out by Jaypan, it was due to a bug in the bootstrap_barrio theme.

I have posted a patch for it: https://www.drupal.org/project/bootstrap_barrio/issues/3083728#comment-13527917