Details
-
Type:
Bug
-
Status:
Resolved
-
Priority:
Minor
-
Resolution: Won't Fix
-
Affects Version/s: 1.9.5
-
Fix Version/s: None
-
Component/s: Zend_Config
-
Labels:None
Description
I'm not sure if this is an issue of Zend_Config, Zend_Config_Xml, the core parser itself or whatever is under the hood of those components. Here's the case:
I have a xml config file, which I used with Zend_Navigator to display a website menu. The file is encoded with ISO-8859-1 on the disk, and the headers inside the file say:
<?xml version="1.0" encoding="ISO-8859-1" ?>
In my bootstrap, I have:
protected function _initNavigation() {
$registry = Zend_Registry::getInstance();
$layout = $registry->get('Zend_Layout');
$view = $layout->getView();
$config = new Zend_Config_Xml(APPLICATION_PATH . '/config/navigation.xml', 'nav');
$navigation = new Zend_Navigation($config);
$view->navigation($navigation);
}
So far so good. When I tell my layout renderer to display the menu, with
echo $this->navigation()->menu();
I get garbled accents, i.e. "InÃcio" instead of "Início".
Content-Type headers are being sent out to tell the browser we're using ISO-8859-1:
<?php header('Content-Type: text/html; charset=iso-8859-1'); ?>
...
<meta http-equiv="Content-Type" content="text/html;charset=iso-8859-1" />
If I change browser encoding to UTF-8, it displays right.
So far I've been using utf8_decode() to fix it. I believe there's something wrong with the XML parser.
I'd be interested to know if you are still having problems and whether it turned out to be an issue with Zend_Config_Xml.