本文整理自网络,侵删。
function UTF8FileBOM(const FileName: string): boolean;var txt: file; bytes: array[0..2] of byte; amt: integer;begin FileMode := fmOpenRead; AssignFile(txt, FileName); Reset(txt, 1); try BlockRead(txt, bytes, 3, amt); result := (amt=3) and (bytes[0] = $EF) and (bytes[1] = $BB) and (bytes[2] = $BF); finally CloseFile(txt); end;end;
https://bbs.csdn.net/topics/390275052
相关阅读 >>
Delphi [数据库连接字符串] access 连接字符串
更多相关阅读请进入《Delphi》频道 >>