URL escaping MFC strings
问题 How do you URL escape an MFC CString? 回答1: InternetCanonicalizeUrl() 回答2: I created a wrapper function for others who may come across this solution. Also requires linking to Wininet.lib and including wininet.h bool EscapeURL ( CString& url, DWORD options = ICU_DECODE | ICU_ENCODE_PERCENT ) { DWORD bytes = url.GetLength () + 1; LPTSTR escapedString = new TCHAR[bytes + 1]; escapedString[0] = 0; // First read will generate the correct byte count for the return string // bool result =