login about faq

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

asked Jun 27 '15 at 01:46

dragon's gravatar image

dragon
333711

edited Jun 27 '15 at 09:44

jpbro's gravatar image

jpbro ♦
1.1k2618

Be the first one to answer this question!
toggle preview

Follow this question

By Email:

Once you sign in you will be able to subscribe for any updates here

By RSS:

Answers

Answers and Comments

Markdown Basics

  • *italic* or __italic__
  • **bold** or __bold__
  • link:[text](http://url.com/ "title")
  • image?![alt text](/path/img.jpg "title")
  • numbered list: 1. Foo 2. Bar
  • to add a line break simply add two spaces to where you would like the new line to be.
  • basic HTML tags are also supported

Tags:

×26

Asked: Jun 27 '15 at 01:46

Seen: 530 times

Last updated: Jun 27 '15 at 09:44

powered by OSQA