Hi Michael, Your script works fine. The only problem I'm having is that it does not support html entities.
The following code will cause the page to crash: <p>©</p> I think that's because you're using loadXML and not loadHTML. Has anyone from the dev team contacted the libxml guys about the utf-8 issue with loadHTML()? __ Raymond Irving --- On Mon, 4/13/09, Michael A. Peters <mpet...@mac.com> wrote: > From: Michael A. Peters <mpet...@mac.com> > Subject: Re: [PHP] Generate XHTML (HTML compatible) Code using DOMDocument > To: "Michael Shadle" <mike...@gmail.com> > Cc: "Raymond Irving" <xwis...@yahoo.com>, "firstname.lastname@example.org" > <email@example.com> > Date: Monday, April 13, 2009, 5:56 AM > Michael A. Peters wrote: > > > > > I wonder if the real utf8 problem people experience is > really with loadHTML() and not with saveHTML() ?? > > > > Go to http://www.clfsrpm.net/xss/dom_script_test.php > > The page was meant to test something else but enter some > UTF-8 into the textarea (well formed xhtml) - > > With IE - html 4 is the only thing it will output but with > FireFox and Opera, by default it outputs xhtml but you can > check a box to force html. > > When it outputs html it uses saveHTML() > When it outputs xhtml it uses saveXML() > > The source is linked there so you can see. > > Anyway - it looks saveHTML() works fine with UTF8 as long > as loadXML() was used to load the data. > > I've tried both Hebrew and Polytonic Greek. > It outputs correctly regardless of html or xhtml - but only > after I changed the code to load the textarea as xml opposed > to html. > > -- PHP General Mailing List (http://www.php.net/) > To unsubscribe, visit: http://www.php.net/unsub.php > > -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php