Mokus
Mokus

Reputation: 10410

DomDocument encoding

I have small problem. I'm trying to work on an XML file, but the UTF-8 character encoding not working.

Example:

$dom = new DomDocument('1.0', 'UTF-8');     
if(!$dom->load($url))
    die('There is a problem to getting the source file!');

The output:

Array(
    [league] => Regionalliga Süd
    [team1] => WORMATIA WORMS
    [team2] => 1. FC NÃœRNBERG II
)

Any suggestion regarding this problem?

Upvotes: 0

Views: 352

Answers (1)

Dr.Molle
Dr.Molle

Reputation: 117364

It's not a problem of the encoding of the XML-document, it's a problem of the encoding of the running PHP-script. Be sure that the php-script is also encoded in UTF-8 and the correct charset-header is sent to the browser.

Upvotes: 1

Related Questions