笨办法
var
fs:tfilestream;
ss:tstringstream;
str:string;
begin
fs:=tfilestream.create('test.txt',fmopenreadwrite);
ss:=tstringstream.create('');
fs.position:=0;
ss.copyfrom(fs,fs.size);
str:=ansitoutf8(ss.datastring);
fs.size=0;
fs.write(ss[1],length(ss));
fs.free;
ss.free;
end;