Re: loadHTML/loadHTMLFile - DOM functions

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



Leonidas Safran wrote:
 > I tried following:

I downloaded the ominous html page, coded it as UTF-8 (with text-editor option) and added a metag-tag declaring utf-8 encoding:
<meta http-equiv = 'content-type' content = 'text/html; charset=UTF-8'>

I checked that the special characters were written correctly then (actually I had to correct them).
Then I used the function:
$doc = new DomDocument('1.0', 'UTF-8');

The result is still the same, special chars are displayed wrong. Different wrong than before :-) but still wrong... ("ä" is now "ä").

I tried analogy to do the same with "ISO-8859-1" but it's not getting better...

So, fazit, even converting the whole document in UTF-8 and adding UTF-8 charset declaration to it, doesn't help me handling special chars...

And what about the img-tags which are converted into what ever invisible chars (empty spaces looking at the source code)...?

Do you have your code somewhere?

Another thing I realized that I failed to mention before is that
using saveXML($element) will serialize the full element, but outputs it in UTF-8 encoding. Have you tried converting the output of that to the encoding of the original HTML page?

Rob

--
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php


[Index of Archives]     [PHP Home]     [Apache Users]     [PHP on Windows]     [Kernel Newbies]     [PHP Install]     [PHP Classes]     [Pear]     [Postgresql]     [Postgresql PHP]     [PHP on Windows]     [PHP Database Programming]     [PHP SOAP]

  Powered by Linux