Question:
Hi Chilkat,
I need to send Chinese character string to perform a login session. One of the param is a Chinese string :
If the Chinese string is odd number of chars, the AddParam (utf8) "value" content is empty !
eg. 我的上
act=login&tbUserAccount=&tbUserPwd=PP&tbCode=&nextAutoLogin=1
tbUserAccount= empty !
If the Chinese string is even number of chars, no issue at all. I can perform a successful login !
eg. 我的上海
act=login&tbUserAccount=%E6%88%91%E7%9A%84%E4%B8%8A%E6%B5%B7&tbUserPwd=PP&tbCode=&nextAutoLogin=1
tbUserAccount= not empty !
Lib is the v9.5.0.51 x86 vc9 win32.
BengRequest.put_HttpVerb("POST"); BengRequest.put_Path("/login.php"); BengHttp.put_RedirectVerb(""); BengRequest.AddHeader("Accept","application/json, text/javascript, */*; q=0.01"); BengRequest.AddHeader("Content-Type","application/x-www-form-urlencoded; charset=UTF-8"); BengRequest.AddHeader("X-Requested-With","XMLHttpRequest"); BengRequest.AddHeader("Accept-Language","zh-CN"); BengRequest.AddHeader("User-Agent","Mozilla/5.0 (Windows NT 6.1; WOW64; Trident/7.0; rv:11.0) like Gecko"); BengRequest.AddHeader("Connection","Keep-Alive"); BengRequest.AddHeader("Host",szDomain); BengRequest.AddHeader("Pragma","no-cache"); BengRequest.AddParam("act","login"); szCkStr.append(szUserAccount); // CkString szStr declared already szUtfStr= szCkStr.getStringUtf8(); // const char *szUtfStr declared already BengRequest.AddParam("tbUserAccount",szUtfStr); BengRequest.AddParam("tbUserPwd",szUserPwd); BengRequest.AddParam("tbCode",""); BengRequest.AddParam("nextAutoLogin","1"); BengResponse = BengHttp.SynchronousRequest(szDomain,80,false,BengRequest);
Fya, if the above-mentioned is a bug.
Thanks.
Best regards Dragon