Home > Back-end >  XE7, IdHTTPServer CommandGet take the POST of Chinese garbled issue, but also can't D7, how to
XE7, IdHTTPServer CommandGet take the POST of Chinese garbled issue, but also can't D7, how to

Time:09-28

XE7, IdHTTPServer CommandGet take the POST of Chinese garbled issue, but also can't D7, how to solve?
Exactly the same code, XE7 is stil


Procedure TForm1. IdHTTPServer1CommandGet (AThread: TIdPeerThread;
ARequestInfo: TIdHTTPRequestInfo; AResponseInfo: TIdHTTPResponseInfo);
Var
Request: the string;
The begin
ARequestInfo. ContentType:='text/HTML. Charset=utf-8 ';
Request:=UTF8Decode (ARequestInfo. Params. Text);
Memo1. Lines. The Add (FormatDateTime (' YYYY - - DD HH: MM NN: SS ', NOW) + 'rev: + Request);
AResponseInfo. ContentType:='text/HTML. Charset=utf-8 ';
AResponseInfo. ContentText:=UTF8Encode (Request);
end;

CodePudding user response:

USES HttpAPP
Request:=ARequestInfo. UnparsedParams;
Request:=HttpApp HTTPDecode (Request);
This is ok