function SbctoDbc(s: string): string;
var
nlength, i: integer;
str, ctmp, c1, c2: string;
begin
nlength := length(s);
if (nlength = 0) then
exit;
str := '';
setlength(ctmp, nlength + 1);
ctmp := s;
i := 1;
while (i <= nlength) do
begin
c1 := ctmp[i];
c2 := ctmp[i + 1];
if (c1 = #163) then
begin
str := str + chr(ord(c2[1]) - 128);
inc(i, 2);
continue;
end;
if (c1 > #163) then
begin
str := str + c1;
str := str + c2;
inc(i, 2);
continue;
end;
if (c1 = #161) and (c2 = #161) then
begin
str := str + ' ';
inc(i, 2);
continue;
end;
str := str + c1;
inc(i);
end;
result := str;
end;