Four Js Development Tools Forum

Discussions by product => Genero BDL => Topic started by: Andrew C. on October 28, 2009, 05:19:04 am



Title: Changing the XML encoding of a file to be written
Post by: Andrew C. on October 28, 2009, 05:19:04 am
Hey folks,

I'm building a DOM (om?) tree under an DomDocument and then writing it to a file:

Code
  1. let doc = om.DomDocument.create("testsuite")
  2. let dnRoot = doc.getDocumentElement()
  3. ### BUILD A TREE under dnRoot
  4. # dump the document
  5. call dnRoot.writeXml("test.xml")
  6.  

However the emitted file has a default encoding that I want to be UTF-8:

Code
  1. <?xml version='1.0' encoding='ANSI_X3.4-1968'?>

How can I affect the encoding? I don't want to have to manually emit the document using a SAX writer, but I guess I will if I have to...

Current version Genero is 2.11 but 2.20 is very close for us, and I can wait for that if it can do it more easily.


Title: Re: Changing the XML encoding of a file to be written
Post by: Reuben B. on October 28, 2009, 06:20:26 am
Hi Andrew,

Did you see this discussion from a few months ago https://4js.com/fjs_forum/index.php?topic=338.0

Reuben


Title: Re: Changing the XML encoding of a file to be written
Post by: Andrew C. on October 28, 2009, 07:12:28 am
No, but I have now! Thanks, that answers the question, and also tells me I need not worry for normal ASCII output that is the TRUE output of my process.

cheers