F
flyingco
URL decoding/encoding problem
Iif the url contains chinese char,the url will be encoded.
For example :
url:http://194.0.0.84/ÖÐÎÄÒ³Ãæ.htm
when my tdi driver intercept the packet, I find that "ÖÐÎÄÒ³Ãæ.htm"
has been encoded to "%E4%B8%AD%E6%96%87%E9%A1%B5%E9%9D%A2.htm"
when I decode it with utf8 ,the content still is not decoded;
My codes as follow:
char szMySer[MAX_PATH] ={"%E4%B8%AD%E6%96%87%E9%A1%B5%E9%9D%A2.htm"};
char *strTem =utf8_gb(szMySer);
AfxMessageBox(strTem);
strTem ="%E4%B8%AD%E6%96%87%E9%A1%B5%E9%9D%A2.htm";
utf8_gb is used to decode string with utf8,it is a very correct fuction
I have used many times.
what's wrong with my code? or Do you have any good idea?
thanks.
Iif the url contains chinese char,the url will be encoded.
For example :
url:http://194.0.0.84/ÖÐÎÄÒ³Ãæ.htm
when my tdi driver intercept the packet, I find that "ÖÐÎÄÒ³Ãæ.htm"
has been encoded to "%E4%B8%AD%E6%96%87%E9%A1%B5%E9%9D%A2.htm"
when I decode it with utf8 ,the content still is not decoded;
My codes as follow:
char szMySer[MAX_PATH] ={"%E4%B8%AD%E6%96%87%E9%A1%B5%E9%9D%A2.htm"};
char *strTem =utf8_gb(szMySer);
AfxMessageBox(strTem);
strTem ="%E4%B8%AD%E6%96%87%E9%A1%B5%E9%9D%A2.htm";
utf8_gb is used to decode string with utf8,it is a very correct fuction
I have used many times.
what's wrong with my code? or Do you have any good idea?
thanks.