[delphi]代码库
if lowercase( GetTextType( strFileName))= 'tfunicode' then
begin
str := LoadUnicodeFile(strFileName);
Memo1.Clear;
Memo1.Lines.Add(str);
end;
if lowercase( GetTextType( strFileName))= 'tfansi' then
begin
Memo1.Lines.LoadFromFile(strFileName) ;
str := Utf8ToAnsi(Memo1.Text) ;
Memo1.Clear ;
Memo1.Lines.Add (str);
end;
if lowercase( GetTextType( strFileName))= 'tfutf8' then
begin
str := LoadUTFFile(strFileName);
Memo1.Clear;
Memo1.Lines.Add(str);
end;
if trim(memo1.Text)='' then
begin
Memo1.Lines.LoadFromFile(strFileName) ;
end;