function sfromA (s:
string):
string;
{ Ansi -> Oem }
var i: integer;
asciibuffer, ansibuffer:
array of byte;
begin
SetLength(ansibuffer,LENGTH(s));
SetLength(asciibuffer,LENGTH(s));
for i:=1
to LENGTH(s)
do ansibuffer[i-1]:=ORD(s[i]);
asciibuffer:=System.Text.Encoding.Convert(Encoding.
Default,Encoding.GetEncoding(850),ansibuffer);
result:=String(asciibuffer);
end;
function sfromO (s:
string):
string;
{ Oem -> Ansi }
var i: integer;
ss: ansistring;
buffer:
array of byte;
Encoding: System.Text.Encoding;
begin
ss:=s;
SetLength(buffer,LENGTH(s));
for i:=1
to LENGTH(s)
do buffer[i-1]:=ORD(ss[i]);
Encoding:=System.Text.Encoding.GetEncoding(850);
result:=Encoding.Getstring(buffer,0,LENGTH(s));
end;