大家好,请教一个问题,我用delphi写的接收邮件系统,接收邮件的时候邮件标题显示乱码.
邮件标题出现这样:鏉ㄥ織鍗
正文成这样:琛屾斂蹇樿璋冩暣锛岃ˉ鍙戠粰浣犮€?
请问怎么转换成正常的简体中文?
邮件标题出现这样:鏉ㄥ織鍗
正文成这样:琛屾斂蹇樿璋冩暣锛岃ˉ鍙戠粰浣犮€?
请问怎么转换成正常的简体中文?
解决方案 »
- 谁用过RemObjects啊?它的SOAP怎么才能被Java或.Net引用啊!
- delphi中用TcomboBox实现自动列举数据库中信息的功能的一些问题!?知道的请进啊!!!加分
- 求能在CLX下面用的串口通信控件~~~
- keybd_event( VK_NUMLOCK, $45, KEYEVENTF_EXTENDEDKEY or 0,0 );在win2000下无效?
- 好心的过路人帮帮忙吧!
- 紧急求助!delphi开发的数据库程序客户端怎么连接到数据库服务器?
- 大家探讨以下,会以下技术的程序员能开多少?
- 郁闷时的原创-------标题过短?
- 大家快来抢分啊!
- 急需解决的关于日期的问题,请问如何截获这个错误?请各位大侠帮忙
- item(i).innertext 取不到值!
- delphi=2=1+1
var SourceLength:integer;
DoneLength:integer;
AscNo:integer;
Byte1,Byte2,Byte3:integer;
begin
GbStr:='';
if Trim(unicodestr)='' then exit; SourceLength:=Length(UnicodeStr);
DoneLength:=1;
repeat
AscNo:=ord(UnicodeStr[DoneLength]);
case (AscNo and $E0) of
$E0:begin
Byte1:=(AscNo and $0f) shl 12;
Inc(DoneLength);
if DoneLength>SourceLength then break;
AscNo:=ord(UnicodeStr[DoneLength]);
Byte2:=(AscNo and $3f) shl 6;
Inc(DoneLength);
if DoneLength>SourceLength then break;
AscNo:=ord(UnicodeStr[DoneLength]);
Byte3:=AscNo and $3f;
end;
$C0:begin
Byte1:=(AscNo and $1f) shl 6;
Inc(DoneLength);
if DoneLength>SourceLength then break;
AscNo:=ord(UnicodeStr[DoneLength]);
Byte2:=(AscNo and $3f);
Byte3:=0;
end;
0..$bf:begin
Byte1:=AscNo;
Byte2:=0;
Byte3:=0;
end;
end;//case;
GbStr:=GBStr+widechar(Byte1+Byte2+Byte3);
Inc(DoneLength);
if DoneLength>SourceLength then break;
until DoneLength>=SourceLength;
end;
function UnicodeToUtf8(Dest: PChar; Source: PWideChar; MaxBytes: Integer): Integer;overload; deprecated;DescriptionCall UnicodeToUtf8 to convert a Unicode string to a null-terminated sequence of UTF-8 characters.Dest receives the resulting null-terminated array of UTF-8 characters.MaxDestBytes or MaxBytes indicates the number of bytes available in the buffer specified by Dest, not counting the byte for the null terminator. Source is an array of Unicode characters.SourceChars is the number of characters in Source. If SourceChars is not specified, Source must be null-terminated.UnicodeToUtf8 returns the number of bytes written to Dest.