var ss,ss1: WideString;  //注意这里
        ss1 := Copy(ss,Length(ss)-1,1);

解决方案 »

  1.   

    to genphone_ru(票票) 
    你写的是installshield脚本吗?to HHBB()
    问题是不一定是中文或者英文
      

  2.   

    先对szpath右边第一个字符做判断,如果是英文、数字,常用符号,则取右边第一个字符,如不是则去右边的两个字符
      

  3.   

    ss1 := Copy(ss,Length(ss)-1,1);
    if ss1[1]>#127 then
      ss1 := Copy(ss,Length(ss)-2,2);   
      

  4.   

    ss1 := Copy(ss,Length(ss)-1,1);
    if ss1[1]>#127 then
      ss1 := Copy(ss,Length(ss)-2,2);   
      

  5.   

    用Api函数判断是否中文字符
    IsDBCSLeadByte
    具体可查Delphi自带的Windows SDK帮助
      

  6.   

    var ss,ss1: WideString;  //注意这里!!!!!!!
            ss1 := Copy(ss,Length(ss)-1,1);
      

  7.   

    各位大哥,我现在是在Installshield里写安装啊
      

  8.   

    有一个办法,delphi提供了专门处理多字节字符的数据类型LongString,我在公司的中文短信程序常使用它。
    下面的程序在delphi中测试通过(重点看GetRightChar函数):
    unit Unit1;interfaceuses
      Windows, Messages, SysUtils, Classes, Graphics, Controls, Forms, Dialogs,
      StdCtrls;type
      TForm1 = class(TForm)
        Edit1: TEdit;
        Button1: TButton;
        Edit2: TEdit;
        procedure Button1Click(Sender: TObject);
      private
        function GetRightChar(s:string):string;
        { Private declarations }
      public
        { Public declarations }
      end;var
      Form1: TForm1;implementation{$R *.DFM}procedure TForm1.Button1Click(Sender: TObject);
    var
     s:string;
    begin
     s:=edit1.text;
     edit2.text:=GetRightChar(s);
    end;function TForm1.GetRightChar(s: string): string;
    var
      ws:WideString;
      len:integer;
    begin
      result:='';
      if length(s)>0 then
      begin
        ws:=s;
        len:=length(ws);//如果字符串中还有中文你会发觉len值
        Result:=ws[len];
      end;
    end;
    end.