ZF-8342: Zend_Form_Element_Select addMultiOption method fails to render labels/options containing £
Description
I have some multioptions (which are monetary values), If I add elements like so:
$prices = array([0]=>'20000'........etc
foreach ($prices as $price) {
$minprice->addMultiOption($price,'£'.number_format($price));
}
The select box comes out with the correct amount of options, with the values set, but nothing between the tags and nothing on the label attribute.
Comments
Posted by Steve Hollis (stevehollis) on 2009-11-20T00:44:32.000+0000
Please supply code to reproduce.
Ignoring the encoding issue, the following code:
...produces:
Posted by Nick Pack (nickpack) on 2009-11-20T01:00:10.000+0000
Form extends Zend_Form in the usual manner (as per the quickstart)
In the init() method:
Which produces:
$this->_settings['pricerange'] array is set from application.ini via a bootstrap method, storing them in the registry.
View is set as follows (incase that helps):
Simply omitting the £ the option label etc are set correctly.
Posted by Matthew Weier O'Phinney (matthew) on 2009-11-20T11:46:51.000+0000
I've added a test case for this, and, quite simply, am unable to reproduce the issue. Most likely, it's a problem related to encoding of the script and/or your web server.
Posted by Nick Pack (nickpack) on 2009-11-23T00:57:41.000+0000
As per your suggestion about encoding, removing $view->setEncoding('UTF-8'); from my bootstrap gets this a step further, but results in:
View is set up as follows:
The app follows almost to a T the quick start (in terms of structure, the default layout etc), can you give me any pointers in order to get this resolved?
Thanks
Posted by Nick Pack (nickpack) on 2010-01-19T05:52:27.000+0000
Just incase someone else comes across this, I found the cause of the problem outlined above, which as rightly said by Matthew Weier O'Phinney isnt a bug in ZF after all...
The issue is caused by Zend Studio For Eclipse, when run on a mac it defaults to using a mac-roman character set, this is the sole reason seemingly valid code was producing this problem, converting the scripts in question to UTF-8 corrects this problem