diff --git a/Lib/Protocols/IdHTTP.pas b/Lib/Protocols/IdHTTP.pas index ce36c883d..bc0b66938 100644 --- a/Lib/Protocols/IdHTTP.pas +++ b/Lib/Protocols/IdHTTP.pas @@ -880,7 +880,7 @@ function WWWFormUrlEncode(const ASrc: string; AByteEncoding: IIdTextEncoding EnsureEncoding(AByteEncoding, encUTF8); {$IFDEF STRING_IS_ANSI} EnsureEncoding(ASrcEncoding, encOSDefault); - LChars := ASrcEncoding.GetChars(RawToBytes(ASrc[1], Length(ASrc))); + LChars := ASrcEncoding.GetChars(PByte(PAnsiChar(ASrc)), Length(ASrc)); {$ENDIF} // 2 Chars to handle UTF-16 surrogates @@ -3186,7 +3186,7 @@ procedure TIdCustomHTTP.DoRequest(const AMethod: TIdHTTPMethod; Response.ResponseText := InternalReadLn; FHTTPProto.RetrieveHeaders(MaxHeaderLines); ProcessCookies(Request, Response); - if (Response.ResponseCode div 100) <> 1) or (Response.ResponseCode = 101) then begin + if ((Response.ResponseCode div 100) <> 1) or (Response.ResponseCode = 101) then begin Break; end; Response.Clear;