diff --git a/hslib.pas b/hslib.pas index af97481..18b539e 100644 --- a/hslib.pas +++ b/hslib.pas @@ -118,7 +118,7 @@ ThttpRequest = record ver: ansistring; firstByte, lastByte: int64; // body interval for partial requests headers, cookies: ThashedStringList; - user,pwd: ansistring; + user,pwd: string; end; ThttpPost = record @@ -1055,6 +1055,7 @@ procedure ThttpConn.processInputBuffer(); function parseHeader():boolean; var r, s: ansistring; + u: string; i : integer; begin result:=FALSE; @@ -1097,9 +1098,9 @@ procedure ThttpConn.processInputBuffer(); if AnsiStartsText('Basic',s) then begin delete(s,1,6); - s:=base64decode(s); - request.user:=trim(chop(':',s)); - request.pwd:=s; + u:=UTF8decode(base64decode(s)); + request.user:=trim(chop(':',u)); + request.pwd:=u; end; s:=getHeader('Connection'); diff --git a/main.pas b/main.pas index 0c32184..36c2619 100644 --- a/main.pas +++ b/main.pas @@ -6365,7 +6365,7 @@ function TmainFrm.getCfg(exclude:string=''):string; begin case encoding of E_PLAIN: result:=s; - E_B64: result:=base64encode(s); + E_B64: result:=b64utf8(s); E_ZIP: begin result:=zCompressStr(s, clMax); @@ -6719,7 +6719,7 @@ function TmainFrm.setCfg(cfg:string; alreadyStarted:boolean):boolean; if p = 'login' then begin if not anycharIn(':', t) then - t:=base64decode(t); + t:=decodeB64utf8(t); a.user:=chop(':',t); a.pwd:=t; end