Re: [PHP] Re: PHP DOM saveHTML outputs entities



Tijnema ! wrote:
Did you set the UTF8 format in the html_entity_decode function?
so your code would become:
<?php
$dom = new DOMDocument('1.0','utf-8');
$dom->loadXML("<html><body>שלום</body></html>");
$output = $dom->saveHTML();
header("Content-Type: text/html; charset=UTF-8");
echo html_entity_decode($output,ENT_QUOTES,"UTF-8");
?>

Yes. This works... thanks! :-)

But actually I wanted to avoid the saveHTML() method from converting to html entities in the first place, if possible at all.

-thanks!
.



Relevant Pages

  • Re: Developing in Access 2003 for Access 97 users
    ... one earlier this year using 2003 and converting back at the end: ... It kinda depends what functionality you use, but avoid stuff like: ... After conversion to A97, you will still need to change ... rather than allenbrowne at mvps dot org. ...
    (comp.databases.ms-access)
  • Re: Where to find nanofarad capacitors in the US?
    ... Are they common? ... Even converting to pF/uF I still can't find a match. ... Its use is encouraged in order to avoid using the decimal point in component ...
    (sci.electronics.basics)
  • Convert image to hexadecimal
    ... including data of type image. ... To avoid having to use textcopy.exe or ... textptr, I want to have the image data part of the insert-statements by ... converting the binary image data to hexadecimal strings. ...
    (microsoft.public.sqlserver.programming)
  • Re: New Siemens High Speed Train Order for DB
    ... mph to avoid certain safety requirements? ... I was thinking more of one journalist converting it to imperial then a sub-editor thinking it's German therefore it must be metric and converting it back again. ...
    (uk.railway)
  • Re: an element from a set
    ... how would you avoid creating the list? ... iterator = iter ... multiple times from the same set, you're better off just converting it ...
    (comp.lang.python)