Setzen der
Encoding
-Eigenschaft und speichern in einen Stream:
Delphi-Quellcode:
procedure justXmlThings();
const
xmlContent:
String =
'
<?xml version="1.0" encoding="ISO-8859-1"?>' + sLineBreak +
'
<Formula>' + sLineBreak +
'
<Item Typ="6">' + sLineBreak +
'
<DBItem>' + sLineBreak +
'
<ProcLabel>W?rzek?hlen</ProcLabel>' + sLineBreak +
'
...' + sLineBreak +
'
</DBItem>' + sLineBreak +
'
</Item>' + sLineBreak +
'
</Formula>';
var
xmlDoc: IXMLDocument;
output: TStringStream;
begin
xmlDoc := NewXMLDocument();
xmlDoc.Active := True;
xmlDoc.LoadFromXML(xmlContent);
xmlDoc.Encoding := '
ISO-8859-1';
output := TStringStream.Create();
xmlDoc.SaveToStream(output);
WriteLn(output.DataString);
end;