Hi!

I'm trying to get a formatted currency, but the currency symbol is
misrepresented; my character set is ISO-8859-1 but the symbol appears
to be in UTF-8. Does anyone know how to solve this?

Snippet:

<?php

require_once('Zend/Currency.php');
require_once('Zend/Debug.php');

class TestController extends Zend_Controller_Action {

    public function indexAction() {
        $this->_helper->viewRenderer->setNoRender();

        ini_set('default_charset', 'ISO-8859-1');

        // Uncomment to get the correct results
        // ini_set('default_charset', 'UTF-8');

        // Expected: ISO-8859-1
        // Actual: ISO-8859-1
        Zend_Debug::dump(iconv_get_encoding('internal_encoding'));

        $currency = new Zend_Currency('nl_NL'); // Dutch

        // Expected: € 120,45
        // Actual: € 120,45
        Zend_Debug::dump($currency->toCurrency(120.45));

        // Expected: ISO-8859-1
        // Actual: UTF-8
        Zend_Debug::dump(iconv_get_encoding('internal_encoding'));
    }
}

?>

Thanks!

Reply via email to