如何将 TIdBytes 编码为 Base64 字符串(不是 AnsiString)?
ASocket.IOHandler.CheckForDataOnSource(5);
if not ASocket.Socket.InputBufferIsEmpty then
begin
ASocket.Socket.InputBuffer.ExtractToBytes(data);
// here I need to encode data to base64 string, how ? I don't need AnsiString!!
// var s:string;
s := EncodeBase64(data, Length(data)); // but it will be AnsiString :(
或者如何通过 AContext.Connection.Socket.Write() 发送 AnsiString ?
编译器说从'AnsiString'到'string'的隐式字符串转换
“data”变量包含来自网站的 UTF-8 数据。