NYCPHP Meetup

NYPHP.org

[nycphp-talk] Encoding help?

Anirudh Zala arzala at gmail.com
Fri Feb 23 00:40:08 EST 2007


On Thursday 22 February 2007 20:08, csnyder wrote:
> 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-Prese
>ntation.ppt

Indeed good presentation. Whoever wants to make their application truly i18n 
i.e what you input at client side is processed by PHP in same way is stored 
at database level in same way (particularly MySQL) is what can be searched as 
it is and again is displayed back in browser as it is, should use UTF-8 at 
all levels and stages from database to script to browser.

Anirudh Zala

(30% of Internet traffic 
is wasted by unnecessary 
tabs and spaces.)



More information about the talk mailing list