Registriert seit: 20. Jan 2006
Ort: Lübbecke
11.431 Beiträge
Delphi 12 Athens
|
AW: WideStringlist in UTF-8 mit Delphi 2007 speichern
31. Aug 2023, 15:42
Delphi-Quellcode:
procedure SaveToUTF16(const Filename: string; Content: TWideStrings);
var
BOM: TBytes;
Stream : TFileStream;
Zeile : WideString;
begin
Zeile := Content.Text;
Stream := TFileStream.Create(Filename, fmCreate);
try
BOM := TBytes.Create($FF, $FE);
Stream.WriteBuffer(BOM[0], Length(BOM));
Stream.WriteBuffer(Zeile[1], Length(Zeile)*Sizeof(Zeile[1]));
finally
Stream.Free;
end;
end;
|