public static function utf8PercentEncode($encodeSet, $codePoint)
    {
        if (preg_match($encodeSet, $codePoint) === 1) {
            $result = rawurlencode($codePoint);
            if ($result[0] !== '%') {
                $result = self::percentEncode($codePoint);
            }
        } else {
            $result = $codePoint;
        }
        return $result;
    }
public static function utf8PercentEncode($encodeSet, $codePoint)
    {
        if (preg_match($encodeSet, $codePoint) === 1) {
            $result = rawurlencode($codePoint);
            if ($result[0] !== '%') {
                $result = self::percentEncode($codePoint);
            }
        } else {
            $result = $codePoint;
        }
        return $result;
    }
public static function utf8PercentEncode ( $ encodeSet , $ codePoint ) { if ( preg_match ( $ encodeSet , $ codePoint ) === 1 ) { $ result = rawurlencode ( $ codePoint ) ; if ( $ result [ 0 ] !== '%' ) { $ result = self :: percentEncode ( $ codePoint ) ; } } else { $ result = $ codePoint ; } return $ result ; }
UTF-8 percent encodes a code point, using an encode set.
@link https://url.spec.whatwg.org/#utf_8-percent-encode URL Standard
@param string $encodeSet Regular expression (PCRE) pattern matching exactly one UTF-8 character.
@param string $codePoint Exactly one UTF-8 character.
@return string
UTF - 8 percent encodes a code point using an encode set .