Pear class Config.php and UTF-8

Do you have a question? Post it now! No Registration Necessary.  Now with pictures!


I tried to use the PEAR class Config.php to parse a XML configuration  
file which looks like

<?xml version="1.0" encoding="utf-8"?>
     <item3>€</item3>              <--- EURO sign

The file has been saved as UTF-8 without signature (BOM). (If a BOM is  
used, an error message appears saying, that the XML document is empty.  
So that will not be the solution.)

If I use the following PHP script to parse the XML file, a "?" will be  
displayed instead of the EURO sign:

<?xml version="1.0" encoding="utf-8"?>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN"
        " ">
<html xmlns=" ">
require_once 'Config.php';
$config =& new Config ();
@$root =& $config->parseConfig ('config.xml', 'XML');
if (PEAR::isError ($root))
   die ('Error while reading configuration: ' . $root->getMessage());
$settings = $root->toArray ();
echo ($settings['root']['configuration']['section']['item3']);

Replacing the Euro sign by "äöüß", Firefox 1.5 displays four question  
marks in a diamond, Internet Explorer two different squares followed by  

How can I avoid these errors? Is there a general problem using PEAR  
class Config.php???

Kind regards,

Site Timeline