16,748
社区成员
发帖
与我相关
我的任务
分享
function LoadUTF8File(AFileName: string): WideString;
var
ffileStream:TFileStream;
fAnsiBytes: WideString;
S: string;
begin
ffileStream:=TFileStream.Create(AFileName,fmOpenRead);
SetLength(S,ffileStream.Size);
ffileStream.Read(S[1],Length(S));
fAnsiBytes:= UTF8Decode(Copy(S,4,MaxInt));
Result:= fAnsiBytes;
end;