public static function percentEncodeCodePoints($encodeSet, $codePoints)
    {
        return preg_replace_callback($encodeSet, function ($matches) {
            $result = rawurlencode($matches[0]);
            if ($result[0] !== '%') {
                $result = Infrastructure::percentEncode($matches[0]);
            }
            return $result;
        }, $codePoints);
    }