这个是已经编码的内容,需要解码的
给你一个函数吧
function FDecode(Src: String): String;
var
BeginPos,
EndPos : Integer;
begin
BeginPos := Pos('?B?', Src);
if BeginPos > 0 then
begin
EndPos := Pos('?=', Src);
if EndPos = 0 then
EndPos := Length(Src) + 1;
Src := Copy(Src, BeginPos + 3, EndPos - BeginPos - 3);
FBDecoder.Reset;
FBDecoder.CodeString(Src);
Result := FBDecoder.CompletedInput;
BeginPos := Pos(';', Result);
Result := Copy(Result, BeginPos + 1, Length(Result) - BeginPos);
Exit;
end;
BeginPos := Pos('?Q?', Src);
if BeginPos > 0 then
begin
EndPos := Pos('?=', Src);
if EndPos = 0 then
EndPos := Length(Src) + 1;
Src := Copy(Src, BeginPos + 3, EndPos - BeginPos - 3);
FQDecoder.Reset;
FQDecoder.CodeString(Src);
Result := FQDecoder.CompletedInput;
BeginPos := Pos(';', Result);
Result := Copy(Result, BeginPos + 1, Length(Result) - BeginPos);
Exit;
end;
Result := Src;
end;
其中:
FQDecoder : TIdQuotedPrintableDecoder;
FBDecoder : TIdBase64Decoder;