NYCPHP Meetup

NYPHP.org

[nycphp-talk] Encoding help?

csnyder chsnyder at gmail.com
Thu Feb 22 09:38:08 EST 2007


On 2/22/07, Joseph Crawford <codebowl at gmail.com> wrote:
> ZIt is choking on the e charachter i figured that out but how to stop it
> from choking is the problem.
>
> After checking this is the first line of the XML returned by Google
> <?xml version="
> 1.0" encoding="UTF-8"?>
>

So make sure the text you send is encoded as utf-8. You're probably
sending ISO-8869-1 right now. The iconv functions will help.

It's a good idea these days to use unicode everywhere (forms,
database, output) so you don't have to think about it. Sometimes you
get text from other services, though, and that's when it needs to be
re-encoded.

Anyone who needs an introduction to character encoding in general, and
unicode in particular, should peep Carlos Hoyos presentaion from last
year:
http://www.nyphp.org/content/presentations/smallworld/April2006-nyphp-Presentation.ppt

-- 
Chris Snyder
http://chxo.com/



More information about the talk mailing list