private function parseUrl($string, $decode)
    {
        $this->autoInitialize();

        $function = $decode ? 'curl_unescape' : 'curl_escape';

        if ( ! function_exists($function))
        {
            return $decode ? rawurldecode($string) : rawurlencode($string);
        }

        // PHP >= 5.5.0
        return call_user_func($function, $this->curl, $string);
    }