Answer the question
In order to leave comments, you need to log in
How to force the server to return content in the specified encoding?
Colleagues, welcome.
...
Result := '';
uri := TURI.Create(FBaseUrl);
uri.Path := url;
http := THTTPClient.Create;
http.ConnectionTimeout := 12000;
http.AllowCookies := true;
http.CookieManager := TCookieManager.Create;
http.ContentType := 'text/html; charset=utf8';
http.Accept := 'text/html';
http.AcceptCharSet := 'utf8';
http.AcceptLanguage := 'ru-RU,ru';
http.UserAgent := 'Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/75.0.3770.100 Safari/537.36';
ResponseStream:= TStringStream.Create('', TEncoding.UTF8);
ErrorCounter := 0;
Reload:
IsExcept:= false;
try
Response := http.Get(uri.ToString, ResponseStream);
ResponseStream.SaveToFile('TMKCardLoader.html');
result := ResponseStream.DataString;
except
on E: Exception do
begin
OutputDebugString(Pwidechar(E.Message));
Inc(ErrorCounter);
IsExcept := true;
end;
end;
...
Answer the question
In order to leave comments, you need to log in
For starters, at least on a local machine, you would learn how to set up lamp ;)
Was it a2enmod php7.0 ?
a2endites setting was?
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question