>>我应该怎样在Delphi做这做编码转换呢,
 Delphi中应该有这个编码转换的函数,具体查查书。
>>如VB中有能完成BIG5与GB2312互换的函数,Delphi中有吗?
 VB有这个功能是因为有这个OCX控件吧,你可以把这个控件按装在
Delphi的Activex页也照样可以用.这类控件也很多

解决方案 »

  1.   

    谢谢,但是不满意,不要用OCX,我要用Delphi内部的功能
      

  2.   

    要自己实现BIG5<->GB2312比较麻烦,有N多的编码,D中没有现成的.
    你可以找找这类的VCL控件
      

  3.   

    Delphi又不是专给中国人写的,那会有GB和BIG5的转换功能。
    VB那是因为他有中文版,是专对中国使用的。
    Delphi是通用的。
    GB和BIG5的转换功能的函数到处都有,随便找一网站下载就行了
      

  4.   

    你说的TNMHTTP传输过去为DECODE的问题,其实是你自己设置上有问题这样就可以啦NMHTTP1.OutputFileMode := TRUE;
      

  5.   

    有一个关于Indy的例子:
    uses
      Windows, Messages, SysUtils, Classes, Graphics, Controls, Forms, Dialogs,
      StdCtrls, ExtCtrls, IdBaseComponent, IdComponent, IdTCPConnection,
      IdTCPClient, IdMessageClient, IdSMTP, IdMessage,IdStackConsts;type
      TForm1 = class(TForm)
        Edit1: TEdit;
        Edit2: TEdit;
        Edit3: TEdit;
        Label1: TLabel;
        Label2: TLabel;
        Label3: TLabel;
        Edit4: TEdit;
        Panel1: TPanel;
        Edit5: TEdit;
        Edit6: TEdit;
        Label4: TLabel;
        Label5: TLabel;
        Label6: TLabel;
        Label7: TLabel;
        Memo1: TMemo;
        Button1: TButton;
        IdSMTP1: TIdSMTP;
        CheckBox1: TCheckBox;
        Memo2: TMemo;
        Button2: TButton;
        IdMessage1: TIdMessage;
        procedure Button1Click(Sender: TObject);
        procedure IdSMTP1Connected(Sender: TObject);
        procedure IdSMTP1Status(axSender: TObject; const axStatus: TIdStatus;
          const asStatusText: String);
        procedure IdSMTP1Work(Sender: TObject; AWorkMode: TWorkMode;
          const AWorkCount: Integer);
        procedure IdSMTP1WorkBegin(Sender: TObject; AWorkMode: TWorkMode;
          const AWorkCountMax: Integer);
        procedure IdSMTP1WorkEnd(Sender: TObject; AWorkMode: TWorkMode);
        procedure Button2Click(Sender: TObject);
        procedure FormCreate(Sender: TObject);
      private
        { Private declarations }
      public
        { Public declarations }
      end;var
      Form1: TForm1;implementation{$R *.DFM}procedure TForm1.Button1Click(Sender: TObject);
    begin
      if checkbox1.Checked then IdSMTP1.AuthenticationType := atLogin
            else IdSMTP1.AuthenticationType := atNone;
      IdSMTP1.Host:=edit1.Text;
      IdSMTP1.Port:=25;
      IdSMTP1.UserId:=edit2.Text;
      IdSMTP1.Password:=edit3.Text;    IdSMTP1.Connect;
       with IdMessage1  do
        begin
         body.Clear;
         Body.Add(memo1.Lines.Text);//内容
         From.Text := edit6.Text;
         Recipients.EMailAddresses :=edit4.Text;//收件人
         Subject:=edit5.Text;//主题   end;
       IdSMTP1.Send(IdMessage1);
       IdSmtp1.Disconnect;end;procedure TForm1.IdSMTP1Connected(Sender: TObject);
    begin
      memo2.Lines.Add('已经连接到服务器');
      //IdMessage1.Body:=memo2.Lines;
    end;procedure TForm1.IdSMTP1Status(axSender: TObject;
      const axStatus: TIdStatus; const asStatusText: String);
    begin
      memo2.Lines.Add(asStatusText);
    end;procedure TForm1.IdSMTP1Work(Sender: TObject; AWorkMode: TWorkMode;
      const AWorkCount: Integer);
    begin
      memo2.Lines.Add(inttostr(AWorkCount));
    end;procedure TForm1.IdSMTP1WorkBegin(Sender: TObject; AWorkMode: TWorkMode;
      const AWorkCountMax: Integer);
    begin
      memo2.Lines.Add(inttostr(AWorkCountMax));
    end;procedure TForm1.IdSMTP1WorkEnd(Sender: TObject; AWorkMode: TWorkMode);
    begin
      Memo2.Lines.Add('end');
    end;procedure TForm1.Button2Click(Sender: TObject);
    begin
      IdSMTP1.Disconnect;
    end;end.
      

  6.   

    sasacat(傻傻猫) 兄弟,你说的不对吧!如果  NMHTTP1.OutputFileMode := True;时好像无法POST数据上去吧!
      

  7.   

    sasacat(傻傻猫) 兄弟:而且即使能发上去也还是一样的未解码字串
      

  8.   

    这可是DELPHI帮助上的源代码呀!
    我上次自己用明明可以的呀!
      NMHTTP1.InputFileMode:=False;
      NMHTTP1.OutputFileMode:=True;  //此属性必须为True
      NMHTTP1.ReportLevel:=Status_Basic;
      NMHTTP1.Post('http://127.0.0.1/test.asp','tmp.txt');
      

  9.   

    另外,我用TIdHTTP传上去的数据中如果有HTMP的保留字符(如&<>等),数据接收时就会被截断,是要设置TIdHTTP的什么属性或方法进行发送前的编码吗?还是由我的服务端进行编码或解码动作,这些在VB下实现时都不用开发者考虑的