Subscribe for automatic updates: RSS icon RSS

Login icon Sign in for full access | Help icon Help
Advanced search

Pages: [1]
  Reply  |  Print  
Author Topic: Changing the XML encoding of a file to be written  (Read 9813 times)
Andrew C.
Posts: 48


« 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.
Reuben B.
Four Js
Posts: 1116


« Reply #1 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

Product Consultant (Asia Pacific)
Developer Relations Manager (Worldwide)
Author of https://4js.com/ask-reuben
Contributor to https://github.com/FourjsGenero
Andrew C.
Posts: 48


« Reply #2 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
Pages: [1]
  Reply  |  Print  
 
Jump to:  

Powered by SMF 1.1.21 | SMF © 2015, Simple Machines