Re: How about a saveXHTML for the DOM?

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

 



On Thu, Apr 9, 2009 at 12:25 AM, Michael A. Peters <mpeters@xxxxxxx> wrote:

> I did a little reading on the issue and I don't think php 6 will fix it.
> The issue is with libxml2 - it mutilates utf8 when exporting to html and php
> function wraps the libxml2 function.
>
> The solution?
> I don't know - but perhaps using saveXML() and then using a translation tool
> (maybe xslt?) to convert to HTML.
>
> I actually had a function I wrote using preg_replace (started out as a
> wordpress plugin someone else wrote) but it could not properly handle cdata
> blocks - I'll see if I can find it.
>
> I don't use it anymore as I use saveHTML() now for html output.
>
> Maybe running iconv on the output would fix it?
>

I tried to the best of my abilities. it looks like it was reported as
a bug years ago, but classified as not a bug or something.

I tried iconv, I am not the best hacker when it comes to encoding manipulation.

At the moment this was the best workaround someone had posted, and I
have not sanity checked that this gets into MySQL then back out on the
webpage properly as UTF-8, but it -appears- to work

html_entity_decode($dom->saveHTML(),ENT_QUOTES,"UTF-8");

-- 
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