I have to use a caret (^) in a URL, but when I try it I get back the CURLE_URL_MALFORMAT error code (-3) and GetFailureReason() returns "No URL set!". I thought I could just replace the caret with %5E, but the site I'm trying to connect to doesn't seem to support that syntax. Any ideas?
I tried both Escape() and UrlEncode() and they both return the CURLE_COULDNT_RESOLVE_HOST error (-6) after the call to AsyncGetToString(). GetFailureReason() returns "Could not resolve host:" followed by the modified URL followed by the message "(Misformatted domain name)". I don't think either would work for me anyway since the site I'm trying to access doesn't recognize % escapes, which is really annoying. I think I'm out of luck unless I can pass the caret through unmodified.
between that trick of flipping the authentication information between the http:// and the @ symbol (example above this) and using hex or octal or some other numbering system (not %), then you should be able to come up with some alternate encoding.
Since I'm guessing what you're trying to do, (IN --> function --> OUT), I'm just taking a shot in the dark here.
Well, it doesn't help you solve your problem, but it sounds like that web server is seriously nonconformant to web standards. According to RFC 1738, caret is an "unsafe character" and "All unsafe characters must always be encoded within a URL". Caret is listed as unsafe because is it in a set of characters that "gateways and other transport agents are known to sometimes modify". Again, this doesn't help you unless you can use it to apply pressure to get that server made more compliant.