procedure TForm1.Button3Click(Sender: TObject); var S: UTF8String; F: TextFile; begin S := UTF8Encode(TntEdit1.Text); AssignFile(F, 'C:\test.txt'); Rewrite(F); Write(F, #$EF + #$BB + #$BF); // UTF8?? Write(F, S); CloseFile(F); end;