php/php-src — pull request #353 by realityking (2013-06-01 15:27:37+00:00)
Title: Add new function string_is_ascii

This pull requests makes both a C and PHP function string_is_ascii available. The C function grapheme_ascii_check in intl is removed and its use replaced by this function.

I didn't find any other similar functions like this in the codebase, if there are some please point them out. I'll fix their usage as well.

The same behavior can be achieved in userland but it's a common process when handling unicode data (for performance reasons and to prevent bugs). For example in Joomlae for very redirect send to Internet Explorer we need to check whether it's in the ASCII range or not to work around a bug.

Benchmark results are here: https://gist.github.com/realityking/5690703