build/controllers/Utf8Controller.php
private function unicodeOrd($c)
    {
        $h = \ord($c[0]);
        if ($h <= 0x7F) {
            return $h;
        } elseif ($h < 0xC2) {
            return false;
        } elseif ($h <= 0xDF) {
            return ($h & 0x1F) << 6 | (\ord($c[1]) & 0x3F);
        } elseif ($h <= 0xEF) {
            return ($h & 0x0F) << 12 | (\ord($c[1]) & 0x3F) << 6
                                     | (\ord($c[2]) & 0x3F);
        } elseif ($h <= 0xF4) {
            return ($h & 0x0F) << 18 | (\ord($c[1]) & 0x3F) << 12
                                     | (\ord($c[2]) & 0x3F) << 6
                                     | (\ord($c[3]) & 0x3F);
        }

        return false;
    }
private function unicodeOrd($c)
    {
        $h = \ord($c[0]);
        if ($h <= 0x7F) {
            return $h;
        } elseif ($h < 0xC2) {
            return false;
        } elseif ($h <= 0xDF) {
            return ($h & 0x1F) << 6 | (\ord($c[1]) & 0x3F);
        } elseif ($h <= 0xEF) {
            return ($h & 0x0F) << 12 | (\ord($c[1]) & 0x3F) << 6
                                     | (\ord($c[2]) & 0x3F);
        } elseif ($h <= 0xF4) {
            return ($h & 0x0F) << 18 | (\ord($c[1]) & 0x3F) << 12
                                     | (\ord($c[2]) & 0x3F) << 6
                                     | (\ord($c[3]) & 0x3F);
        }

        return false;
    }
Equivalent for ord() just for unicode.

http://stackoverflow.com/a/10333324/1106908

@param $c
@return bool|int