Here’s a poser for you. Open up a controller and its view and try this:
$this->view->utf8 = 'Si Señor!'; $this->view->html = 'Le Crépe'; $btn1 = new Zend_Form_Element_Button('btn1'); $btn1->setLabel($this->view->utf8); $btn2 = new Zend_Form_Element_Button('btn2'); $btn2->setLabel($this->view->html); $this->view->btn1 = $btn1; $this->view->btn2 = $btn2;
<?php echo 'utf-8: '.$this->utf8.'<br />' 'html: '.$this->html.'<br />' 'btn1: '.$this->btn1.'<br />' 'btn2: '.$this->btn2; ?>
utf8: Si Se�or! html: Le Crépe btn1: () btn2: (Le Crépe)
the (buttons) render, but:
the first one is blank (kind of expected as the utf8 variable doesn’t display either)
the 2nd one displays a label, and the html variable worked as we knew it would, however the ´ entity is displaying in the label.
what does this mean?
does it mean that! the Zend_Form_Element_Button has doubly encoded it?
it must have sent Cr&eacute;pe to the browser!
This is busting my chops! Send it unencoded and it fails to render the label, and send it encoded and it gets encoded twice 😐
UPDATE: You’ve checked character encoding in your code, mac textedit, the db, the templates, the form decorators, the form filters, the forums, irc, but guess what? you forgot the IDE.