#523058 by catch, sun, c960657, smk-ka, pwolanin, andypost: optimize calls to check_plain() by trying to use new PHP 5 features and inlining UTF-8 checking