Search code examples
c++apimfcatlurl-encoding

Is there any exist API for URL-encoding in mfc c++?


I am using the following code:

CAtlNavigateData navData;
CStringA m_strForm = "name=+++&priv=1&password=";
navData.SetPostData((BYTE*)(LPSTR)(LPCSTR)m_strForm, m_strForm.GetLength(), QHTTP_FORM_URLENCODE);

special symbols such as :"+++" need to do url-encoding, without url-encoding, +++ will turned into space.

I need a converer.

CString URLEncodingConvertion(const CString& original)
{
XXX
}

Is there any APIs for doing this in c++? If I implement it myself, maybe I can not take whole situations into account. And can not control the code.

Can anyone help?

Many thanks!


Solution

  • AtlEscapeUrl()