[nycphp-talk] Charsets are still driving me nuts
brian at realm3.com
Thu Mar 6 11:03:34 EST 2008
Same thing goes for strlen(). It won't break, but it reports bytes, so
be aware any validation you're doing using strlen may break. Check out
mb_strlen() for an alternative.
On Wed, Mar 5, 2008 at 7:25 PM, John Campbell <jcampbell1 at gmail.com> wrote:
> 2008/3/5 Cliff Hirsch <cliff at pinestream.com>:
> > Is there a downside to using utf-8?
> No, but there are issues with some string functions. In php4/5
> functions like substr() operate on bytes, and may break UTF-8 strings
> that contain multibyte characters. I'd search your code for things
> like "substr" and "pos", and make sure they are not operating on
> userdata in an unsafe way.
> John Campbell
> New York PHP Community Talk Mailing List
> NYPHPCon 2006 Presentations Online
> Show Your Participation in New York PHP
realm3 web applications [realm3.com]
freelance consulting, application development
More information about the talk