开发者

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');   开发者_如何学C  
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?


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.

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜