如题,我在简体操作系统下,用函数GBtoBIG5(网上下载的)把简体转换成繁体,在繁体操作系统下显示正常,可是我在繁体操作系统下,使用这个函数,转出来的结果,显示的却是乱码!请问在繁体操作系统下有什么办法可以将简体转换成繁体啊?
最好有完整的函数和码表,因为我已经来不及研究了。若能解决,100分全部奉上,不够还可以再加200分。大虾们快救救我啊!

解决方案 »

  1.   

    怎麼可能?首先看在轉碼之前是否已經不是原來的字符了,你可以把一個MEMO控件的Font的Charset設為GB2312_CHARSET在轉換之前查看--如果你的繁體系統支持簡體的話.
    一般我們以Binary方式讀入是不是有亂碼問題的.如果真還有問題的話可以到MSN:[email protected]探討.
      

  2.   

    >转出来的结果,显示的却是乱码GB码在Big5的机器下肯定是乱码呀!根本没有什么问题,就这样交货就可以。同理,Big5码在GB码(简体)机器上肯定也是乱码,可能你没有玩过三国志吧?呵呵......:)
      

  3.   

    >>请问在繁体操作系统下有什么办法可以将简体转换成繁体啊?
    你應該在簡體中作  "简体转换成繁体" 啊!!!
      

  4.   

    我用过这个函数,当时的感觉是这个函数好象是单向的:即简体操作系统下简体==>繁体;繁体操作系统下繁体==>简体.
      

  5.   

    有个思路:不知道在繁体操作系统操作简体转换繁体时,简体文件为UniCode码不知道可不可以
      

  6.   

    我正在做一个远程查询的程序,服务器在大陆,客户在台湾,用的是繁体的操作系统(所以要在繁体系统中进行GB到Big5的转换),数据库中存的是简体,所有的字段用的是支持Unicode的nvarchar、ntext等,现在在客户端中显示数据时,简体全部都是乱码(界面已经没有问题),我用简繁转换的函数转换之后,还是乱码,我已经手足无措了。
      

  7.   

    crossbow(【带三尺剑立不世之功】) :
        为了保证在客户那里能正常使用,我们都是在繁体操作系统中测试,现在数据显示的都是乱码,怎么给客户用啊。:(
        另外,嘿嘿,我可以算是老一代的玩家了,什么沙丘啦、鬼屋啦都玩过,三国当然也玩过啦。
      

  8.   

    crossbow(【带三尺剑立不世之功】)  说的对 hehe^^你没有玩过三国志吧,没有用过内码转换工具吧 哈哈哈就这么交货了就算你转了内码?!你能转的了语言中词的不同吗?
      

  9.   

    to:CDSoftwareWj(95927)
        客户的要求也不高,他们只要显示出来的是繁体的,不要乱码就可以了,词的不同,都无所谓的啦,反正都知道是什么意思.内码转换工具太麻烦了,因为软件是为客户订做的,所以客户的很多要求,都是要满足的,不然就活不下去啦.
      

  10.   

      在csdn的首页,受搜  简繁体字转换器(1.1),软件。你一定会有惊喜的!!!!!!
    带控件的原码!!!!  百分百保证!!!!!!!!!!!!!!!!!!!!!!!!!!!!!http://www.csdn.net/cnshare/soft/16/16635.shtm
      

  11.   

    to:123hui(cr2003)   你给的地址不能下载啊,说是服务器停机了.有没有别的下载网址?
      

  12.   

    你好
    我已经解决了这个问题
    当然,要用这个控件
    但是还不够
    是先要把所有控件标题以语句的形式写下来
    如同:
    frmzh.qrypjlx.DisplayLabel:='票据类型';
    frmzh.qrypjamtn.DisplayLabel:='前一天余额';
    frmzh.qrypjsp.DisplayLabel:='收票';
    frmzh.qrypjdx.DisplayLabel:='兑现';
    frmzh.qrypjye.DisplayLabel:='今天余额';
    frmdl.caption:='登录数据库';
    frmdl.lblserver.caption:='服务器地址';
    frmdl.lblsjkmm.caption:='数据库密码';
    frmdl.lblzh.caption:='数据库帐号';
    frmdl.btnlj.Caption:='连接';
    frmdl.lblygmm.caption:='员工密码';
    frmdl.lblyg.caption:='员工';
    frmdl.lblsjk.caption:='公司别';
    .......
    当然,手工写太繁
    我已写好了函数,太复杂,这里说不清楚
    可以联系我 0512-66332230  郝霄汉
      

  13.   

    procedure Tfrmzh.FormActivate(Sender: TObject);
    var
      reg:tregistry;
      str:string;
      i:integer;
    begin
      //窗口活动
      if dm.yy<>'' then exit;
      //读取注册表国家,日期类型设置
      //登陆前不能读数据库!!!!!!!!@@@@@@@@@@@@@@@@@@@@@
      Reg := TRegistry.Create;
      Reg.RootKey := HKEY_CURRENT_USER;
      if Reg.OpenKey('\Control Panel\International', false) then
      begin
        //国家
        str:=Reg.readString('Locale');
        if str='00000404' then dm.yy:='BIG5' else dm.yy:='GB';
        if (Reg.readString('iCalendarType')='4') and (str='00000404') then
        begin
          //民国历(2002-1911=91)
          dm.mg:=1911;
          dm.mgstr:='1911';
        end
        else
        begin
          //公元历
          dm.mg:=0;
          dm.mgstr:='0';
        end;
        //showmessage(str);
        Reg.CloseKey;
      end;  //遍历所有窗口
      //临时
      //dm.yy:='BIG5';
      if dm.yy<>'GB' then dm.hz;
      for i:=0 to application.ComponentCount-1 do
      begin
        str:=application.Components[i].Name;
        if str='' then continue;
        if application.Components[i] is tform then
        begin
          //标题汉字
          dm.bthz(application.Components[i]);
          //GB-BIG5
          if dm.yy<>'GB' then
            dm.GB2BIG5(application.Components[i]);
        end;
      end;
      if dm.yy='GB' then
        //if fileexists('d:') then
          dm.listbt.SaveToFile('d:\listbt.txt');
      //上次连接过,则没有登陆画面
     end;
      

  14.   

    procedure Tdm.hz;
    begin
    frmzh.caption:='帐户资金';
    frmzh.Label1.caption:='日期';
    frmzh.btncx.Caption:='查询';
    frmzh.Button1.Caption:='报表';
    frmzh.Button2.Caption:='导出Excel';
    frmzh.Button3.Caption:='登录';
    frmzh.DBNavigator1.hints.CommaText:='首记录,前一记录,下一记录,末记录,增加,删除,编辑,提交,取消,刷新';
    frmzh.DBNavigator2.hints.CommaText:='首记录,前一记录,下一记录,末记录,增加,删除,编辑,提交,取消,刷新';
    frmzh.DBNavigator3.hints.CommaText:='首记录,前一记录,下一记录,末记录,增加,删除,编辑,提交,取消,刷新';
    frmzh.DBNavigator4.hints.CommaText:='首记录,前一记录,下一记录,末记录,增加,删除,编辑,提交,取消,刷新';
    frmzh.qryzhbacc_no.DisplayLabel:='帐户代号';
    frmzh.qryzhamtn.DisplayLabel:='前一天余额';
    end;
    //其中,内容来自 d:\list.txt
      

  15.   

    procedure Tdm.GB2BIG5(ck: tobject);
    var
      i:integer;
      zj:TComponent;//组件
    begin
      //GB-->BIG5
      //if dm.yy='GB' then exit;
      //窗口
      if (ck as tform).Tag=1 then exit;
      (ck as tform).Caption:=
          gb.GBtoBIG5( (ck as tform).Caption);
      //窗口上的组件
      for i:=0 to (ck as tform).ComponentCount-1 do
      begin
        zj:=(ck as tform).Components[i];
        //tlabel
        if zj is tlabel then
          (zj as tlabel).Caption:=
            gb.GBtoBIG5( (zj as tlabel).Caption);
        //tqrlabel
        if zj is tqrlabel then
          (zj as tqrlabel).Caption:=
            gb.GBtoBIG5( (zj as tqrlabel).Caption);
        //tfield
        if zj is tfield then
          (zj as tfield).DisplayLabel:=
            gb.GBtoBIG5( (zj as tfield).DisplayLabel);
        //tbutton
        if zj is tbutton then
          (zj as tbutton).Caption:=
            gb.GBtoBIG5( (zj as tbutton).Caption);
        //taction
        if zj is taction then
          (zj as taction).Caption:=
            gb.GBtoBIG5( (zj as taction).Caption);
        //ttabsheet
        if zj is ttabsheet then
          (zj as ttabsheet).Caption:=
            gb.GBtoBIG5( (zj as ttabsheet).Caption);
        //tcheckbox
        if zj is tcheckbox then
          (zj as tcheckbox).Caption:=
            gb.GBtoBIG5( (zj as tcheckbox).Caption);
        //TlineSeries
        if zj is TlineSeries then
          (zj as TlineSeries).Title:=
            gb.GBtoBIG5( (zj as TlineSeries).Title);
        //THorizBarSeries
        if zj is THorizBarSeries then
          (zj as THorizBarSeries).Title:=
            gb.GBtoBIG5( (zj as THorizBarSeries).Title);
        //TBarSeries
        if zj is TBarSeries then
          (zj as TBarSeries).Title:=
            gb.GBtoBIG5( (zj as TBarSeries).Title);
        //tdbcheckbox
        if zj is tdbcheckbox then
          (zj as tdbcheckbox).Caption:=
            gb.GBtoBIG5( (zj as tdbcheckbox).Caption);
        //tcombobox
        if zj is tcombobox then
          (zj as tcombobox).items.CommaText:=
            gb.GBtoBIG5( (zj as tcombobox).items.CommaText);
        //tdbnavigator
        if zj is tdbnavigator then
          (zj as tdbnavigator).hints.CommaText:=
            gb.GBtoBIG5( (zj as tdbnavigator).hints.CommaText);
      end;
      (ck as tform).Tag:=1;
    end;
    procedure Tdm.bthz(ck: tobject);
    var
      i:integer;
      zj:TComponent;//组件
      str:string;
    begin
      //形成标题汉字
      //窗口上的组件
      str:=(ck as tform).Name+'.caption:='+''''+(ck as tform).Caption+''''+';';
      listbt.Add(str);
      for i:=0 to (ck as tform).ComponentCount-1 do
      begin
        zj:=(ck as tform).Components[i];
        str:=(ck as tform).Name+'.'+(ck as tform).Components[i].Name+'.';
        //tlabel
        if zj is tlabel then
          str:=str+'caption:='+''''+(zj as tlabel).Caption+''''+';';
        //tqrlabel
        if zj is tqrlabel then
          str:=str+'caption:='+''''+(zj as tqrlabel).Caption+''''+';';
        //tfield
        if zj is tfield then
        begin
          str:=str+'DisplayLabel:='+''''+(zj as tfield).DisplayLabel+''''+';';
          //字段类型,显示方式
          if (zj as tfield).DataType=ftbcd then
            (zj as tbcdfield).Displayformat:='###,###,###.##';
          if (zj as tfield).DataType=ftinteger then
            (zj as tintegerfield).Displayformat:='###,###,###';
          if (zj as tfield).DataType=ftdatetime then
            (zj as tdatetimefield).Displayformat:='YYYY-M-D';
        end;
        //tbutton
        if zj is tbutton then
          str:=str+'Caption:='+''''+(zj as tbutton).Caption+''''+';';
        //taction
        if zj is taction then
          str:=str+'Caption:='+''''+(zj as taction).Caption+''''+';';
        //ttabsheet
        if zj is ttabsheet then
          str:=str+'Caption:='+''''+(zj as ttabsheet).Caption+''''+';';
        //tcheckbox
        if zj is tcheckbox then
          str:=str+'Caption:='+''''+(zj as tcheckbox).Caption+''''+';';
        //tdbcheckbox
        if zj is tdbcheckbox then
          str:=str+'Caption:='+''''+(zj as tdbcheckbox).Caption+''''+';';
        //tcombobox
        if zj is tcombobox then
        begin
          str:=str+'items.CommaText:='+'''';
          str:=str+(zj as tcombobox).Items.CommaText;
          str:=str+''''+';';
        end;
        //TlineSeries
        if zj is TlineSeries then
          str:=str+'title:='+''''+(zj as TlineSeries).title+''''+';';
        //THorizBarSeries
        if zj is THorizBarSeries then
          str:=str+'title:='+''''+(zj as THorizBarSeries).title+''''+';';
        //TBarSeries
        if zj is TBarSeries then
          str:=str+'title:='+''''+(zj as TBarSeries).title+''''+';';
        //tdbnavigator
        if zj is tdbnavigator then
        begin
          str:=str+'hints.CommaText:='+'''';
          str:=str+'首记录,前一记录,下一记录,末记录,增加,删除,编辑,提交,取消,刷新';
          str:=str+''''+';';
          (zj as tdbnavigator).ShowHint:=true;
          (zj as tdbnavigator).Hints.CommaText:=
              '首记录,前一记录,下一记录,末记录,增加,删除,编辑,提交,取消,刷新';
        end;
        //标题列表,源程序
        if pos('=',str)<>0 then  listbt.Add(str);
      end;
    end;    listbt:tstringlist;//控件标题
    procedure Tdm.DataModuleCreate(Sender: TObject);
    begin  listbt:=tstringlist.Create;end;
    //差不多都在这里了,看不懂再问我
      

  16.   


      如果没有解决,在发信给我,[email protected]   
      感觉要比上面的好,最重要的是方便和准确:) .ocx的控件完全的代码.一看就会:)
      

  17.   

    delphi   project->options-Version info ->language  选 中国(台湾)
      

  18.   

    呵呵, 顶…………要不,可以试试flafhget 的方法,做成文件…………然后自动提取…………