This commit is contained in:
daniele.teti 2013-11-18 10:51:59 +00:00
parent fb2ed8fd9f
commit 1ab21574be

View File

@ -1142,15 +1142,18 @@ var
c: String; c: String;
begin begin
inherited Create; inherited Create;
c := AWebRequest.GetFieldByName('content-type'); c := AWebRequest.GetFieldByName('Content-Type');
CT := c.Split([';']); if not c.IsEmpty then
FContentType := trim(CT[0]);
FContentEncoding := 'UTF-8'; // default encoding
if Length(CT) > 1 then
begin begin
if CT[1].trim.StartsWith('charset', true) then CT := c.Split([';']);
FContentType := trim(CT[0]);
FContentEncoding := 'UTF-8'; // default encoding
if Length(CT) > 1 then
begin begin
FContentEncoding := CT[1].trim.Split(['='])[1].trim; if CT[1].trim.StartsWith('charset', true) then
begin
FContentEncoding := CT[1].trim.Split(['='])[1].trim;
end;
end; end;
end; end;
end; end;