Hi,
In AX 2012 I try to create an XML file and I want to set the encoding but don’t get it to work.
This is the code I use:
static void Job31(Args _args)
{
XmlDocument xmlDoc;
XMLWriter xmlWriter;
XmlWriterSettings xmlWriterSettings;
Filename filename = strFmt( "\\temp\\%1.xml", "encodingtest_ISO-8859-1" );
#define.encoding('ISO-8859-1');
xmlDoc = XmlDocument::newBlank();
xmlWriterSettings = new XmlWriterSettings();
xmlWriterSettings.encoding( #encoding );
xmlWriter = XMLWriter::newFile( filename, xmlWriterSettings );
xmlDoc.writeTo( xmlWriter );
xmlWriter.close();
}
And this is the result:
<?xml version="1.0" encoding="utf-8"?>
Anyone knows how to get ‘ISO-8859-1’ as encoding?
Thanks
Gunnar