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: Tech question for Jolly Park owners
    ... �Any pitfalls to ... converting power. ...
    (rec.games.pinball)
  • PHP DOM saveHTML outputs entities
    ... I'm loading a utf-8 xml file into PHP5 DOM, and then use saveHTML() method. ... The result output always convert characters to html entities in any case. ...
    (php.general)