Re: Generate XHTML (HTML compatible) Code using DOMDocument
| From: | Michael A. Peters | Date: | Mon, 13 Apr 2009 09:56:20 +0000 |
| Subject: | Re: Generate XHTML (HTML compatible) Code using DOMDocument | ||
| References: | 1 2 3 4 | Groups: | php.general |
| Request: | Send a blank email to php-general+get-291416@lists.php.net to get a copy of this message | ||
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.