Re: quite a big bug in DOM

From: Date: Fri, 16 Sep 2005 08:30:28 +0000
Subject: Re: quite a big bug in DOM
References: 1  Groups: php.internals 
Request: Send a blank email to internals+get-19038@lists.php.net to get a copy of this message
On 16.9.2005 10:06 Uhr, Ron Korving wrote: > Hi, > > I found a bug in DOM. It surprises me that it's never been seen and/or fixed > before. I can't find anything about in the PHP bugtracker anyway. The reason > why I'm posting here and not writing a bugreport, is because I'm not sure if > this is a problem in the PHP-extension or the DOM-library itself. In the > latter case there's nothing anybody here can do, I guess. > > This is the situation: > > <?php > $doc = > DOMDocument::loadHTML('<html><body>&nbsp;</body></html>'); > echo > "'".$doc->getElementsByTagName('body')->item(0)->textContent."'\n"; > > $doc = > DOMDocument::loadHTML('<html><body>foo&nbsp;bar</body></html>'); > echo > "'".$doc->getElementsByTagName('body')->item(0)->textContent."'\n"; > ?> > > Output: > > ' ' > 'foo bar' No bug, please check your encoding. It's utf-8 and your terminal has a problem with it.. chregu > > Where the heck do these 'Â's come from when it parses an &nbsp; ? I hope > anyone can shed some light on the next step to be taken in order to fix > this. > > Thanks, > > Ron Korving > -- christian stocker | Bitflux GmbH | schoeneggstrasse 5 | ch-8004 zurich phone +41 1 240 56 70 | mobile +41 76 561 88 60 | fax +41 1 240 56 71 http://www.bitflux.ch | christian.stocker@bitflux.ch | GPG 0x5CE1DECB

« previous php.internals (#19038) next »