NYCPHP Meetup

NYPHP.org

[nycphp-talk] SimpleXML - UTF8

Fernando Gabrieli fgabrieli at gmail.com
Sat Oct 17 22:19:32 EDT 2009


Hi, i believe php.net/mb_convert_encoding will use "?" or just avoid
printing a character when it can't convert. There's also php.net/iconv

On Sat, Oct 17, 2009 at 5:59 PM, John Campbell <jcampbell1 at gmail.com> wrote:

> I hope there is an easy answer to this:
>
> I am using a remote XML service, that about 1 in 100 times returns XML
> with invalid UTF-8 bytes.  I don't have any control over the remote
> service, but simpleXML pukes when I pass malformed UTF-8 to it.  Does
> anyone know of a simple way to cleanup bad UTF-8 bytes, e.g. replace
> the invalid bytes with a '?'.
>
> Rgds,
> John Campbell
> _______________________________________________
> New York PHP Users Group Community Talk Mailing List
> http://lists.nyphp.org/mailman/listinfo/talk
>
> http://www.nyphp.org/Show-Participation
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.nyphp.org/pipermail/talk/attachments/20091017/9fdfba65/attachment.html>


More information about the talk mailing list