急,OutLook 究竟是什么编码? base64? 为什么我用DELPHI,的POP的TidDecodeMIME..解码时,却出错? 请教,OutLook 究竟是什么编码? base64? 为什么我用DELPHI,的POP的TidDecodeMIME.DeCodeString(..)解码时,却出错?急! 解决方案 » 免费领取超大流量手机卡,每月29元包185G流量+100分钟通话, 中国电信官方发货 可以直接这样用..Caption := Base64Decode(IdMessage.From.Text);Caption := Base64Decode(IdMessage.Subject.Text);以下是自己写的,利用Indy9內建De/EncoderMIME解码..//------------------------------------------------------------------------------//Base64Decode//------------------------------------------------------------------------------function TMainForm.Base64Decode(strInput : string) : string;varstrDecode : string;posStart: Integer;posEnd : Integer;beginwhile pos('=?gb2312?b?',lowercase(strInput)) > 0 dobegintryposStart := pos('=?gb2312?b?',lowercase(strInput));posEnd := pos('?=',lowercase(strInput));strDecode := strDecode + copy(strInput,1,posStart-1) + IdDeMIME.DecodeString(copy(strInput,posStart+11,posEnd-posStart-11));strInput := copy(strInput,posEnd+2,length(strInput)-posEnd-1);finallyApplication.ProcessMessages;end;end;strDecode := strDecode + strInput;result := strDecode;end;//------------------------------------------------------------------------------//Base64Encode//------------------------------------------------------------------------------function TMainForm.Base64Encode(strInput : string) : string;varstrEncode : string;beginstrEncode := IdEnMIME.EncodeString(strInput);result := strEncode;end;//------------------------------------------------------------------------------PS.IdDeMIME是IdDecoderMIMEIdEnMIME是IdEncoderMIME MIME-Version: 1.0Content-Type: text/plain; charset="gb2312"Content-Transfer-Encoding: base64X-Priority: 3X-MSMail-Priority: NormalX-Mailer: Microsoft Outlook Express 6.00.3790.0 求优化算法 如何退出外部程序窗口移动状态 [RS485、ID读卡]求助!ID读卡器如何读出卡号? 导出到word出错,高手快来帮忙啊!谢谢:) 怎样把字符串S中的内容COPY到buf中从指定的位置开始处? 调用函数得到系统信息 数据库备份问题(100分) 基础知识菜鸟请教!!!??? 一个超级菜鸟的问题,自己很丢脸 关于如何使的ActiveXForm控件能够在网页里接收参数的问题 一个关于指针和内存分配的问题! 急! 俺用idPOP收邮件时,如果标题是中文的! 就出现乱吗? ,请问这乱码如何解决?
Caption := Base64Decode(IdMessage.From.Text);
Caption := Base64Decode(IdMessage.Subject.Text);
以下是自己写的,利用Indy9內建De/EncoderMIME解码..//------------------------------------------------------------------------------
//Base64Decode
//------------------------------------------------------------------------------
function TMainForm.Base64Decode(strInput : string) : string;
var
strDecode : string;
posStart: Integer;
posEnd : Integer;
begin
while pos('=?gb2312?b?',lowercase(strInput)) > 0 do
begin
try
posStart := pos('=?gb2312?b?',lowercase(strInput));
posEnd := pos('?=',lowercase(strInput));
strDecode := strDecode + copy(strInput,1,posStart-1) + IdDeMIME.DecodeString(copy(strInput,posStart+11,posEnd-posStart-11));
strInput := copy(strInput,posEnd+2,length(strInput)-posEnd-1);
finally
Application.ProcessMessages;
end;
end;
strDecode := strDecode + strInput;
result := strDecode;
end;//------------------------------------------------------------------------------
//Base64Encode
//------------------------------------------------------------------------------
function TMainForm.Base64Encode(strInput : string) : string;
var
strEncode : string;
begin
strEncode := IdEnMIME.EncodeString(strInput);
result := strEncode;
end;//------------------------------------------------------------------------------
PS.
IdDeMIME是IdDecoderMIME
IdEnMIME是IdEncoderMIME
Content-Type: text/plain;
charset="gb2312"
Content-Transfer-Encoding: base64
X-Priority: 3
X-MSMail-Priority: Normal
X-Mailer: Microsoft Outlook Express 6.00.3790.0