function readOnly(count){ }
Starting November 20, the site will be set to read-only. On December 4, 2023,
forum discussions will move to the Trailblazer Community.
+ Start a Discussion

XML document with encoding other than UTF-8

Hi, I need to create an XML document with encoding ISO-8859-1.

In the XML header I added the encoding in the tag writeStartDocument, but when running I get the error message:

Underlying stream encoding 'UTF-8' and input paramter for writeStartDocument() method 'ISO-8859-1' do not match


Looks like UTF-8 is hard-coded somewhere! could not find any learnings on this apart from a comparable message from 2010 on this. Anyone knows or has a solution for this?


XmlStreamWriter la = new XmlStreamWriter();
  la.writeStartDocument('ISO-8859-1', '1.0');