Wenn die Datei Utf-8 ist, aber halt keine BOM hat, versuch mal eine Instanz dieses encodings:
Delphi-Quellcode:
type
{!
<summary>
UTF8 encoding class without BOM, can be used to write files in
UTF8 encoding without a BOM, e.g. XML or XHTML files.
</summary>}
TNoBomUTF8Encoding =
class(TUTF8Encoding)
public
{!
<summary>
Return a zero-elements array to use as a BOM.
</summary>}
function GetPreamble: System.TArray<System.Byte>;
override;
end;
function TNoBomUTF8Encoding.GetPreamble: System.TArray<System.Byte>;
begin
SetLength(Result,0);
end;