XML coding in acucobol

how would i add encoding information using the C$XML call in acucobol 7.2. I understand that version 8 onwards has the SET_ENCODING op.

  • It is a call to C$XML ... Call C$XML with op-code 42 .. see here: CXML-SET-ENCODING (OP-CODE 42)

    Sets the encoding attribute in the XML file. This op-code takes two parameters:

    handle is a valid parser handle

    new-encoding (pic x(n)) is the new encoding value

    While the ISO-8859-1 encoding is supported by C$XML, it always gives strings in UTF-8, regardless of the encoding of the XML file.

    Starting with version 8.1.2, the data returned to the COBOL program will be in one of three (instead of one of two) encodings. If the encoding in the XML file is given as either US-ASCII, UTF-8, or ISO-8859-1, the data returned to the COBOL program will be encoded in that character set. The only other encoding supported by C$XML is UTF-16. If an XML file is parsed that uses UTF-16, the data will be returned to the COBOL program as UTF-8.

    Note that modifying the encoding will most likely cause errors, unless you translate all the data of the XML file into the new encoding before writing it. In other words, changing the encoding attribute does NOT cause the entire XML file to be translated into the new encoding automatically. Caution should be used in this area.

  • You might to look at this thread: community.microfocus.com/.../8748.aspx