function GB2UniCode(GB:string):string;
var
  s: string;
  i, j, k: integer;
  a: array [1..160] of char;
begin
  s:='';
  StringToWideChar(GB, @(a[1]), 500);
  i:=1;
  while ((a[i]<>#0) or (a[i+1]<>#0)) do begin
    j:=Integer(a[i]);
    k:=Integer(a[i+1]);
    s:=s+Copy(Format('%X ',[k*$100+j+$10000]) ,2,4);
    //S := S + Char(k)+Char(j);
    i:=i+2;
  end;
  Result:=s;
end;
function UniCode2GB(S : String):String;
Var I: Integer;
begin
   I :=  Length(S);
   while I >=4  do begin
     try
       Result :=WideChar(StrToInt('$'+S[I-3]+S[I-2]+S[I-1]+S[I]))+ Result;
     except end;
     I := I - 4;
   end;
end;