Skip to Content
0
Former Member
Jul 01, 2010 at 12:21 PM

Cannot get encoding correct using ABAP XML

216 Views

I need to transform data using ABAP transforms and the DOM.

I'm expecting to get a string like this out of the DOM tree when I call IF_IXML_NODE->GET_VALUE( ):

Jukan testityö

Instead I get:

Jukan testityA¶

(This is finnish).

The inbound XML is UTF-8 encoded, and the text is fine when browsing.

I have two issues:

1) When I call CALL TRANSFORM and my xslt code has <xsl:output encoding="utf-8"/>, it works with the XSLT_TOOL in test mode and sets the encoding for the transformed XML as UTF-8. However, when I call CALL TRANSFORM in the program, the encoding of the transformed file is "iso-8859-1". I cannot change the encoding, even if using CALL TRANSFORMATION with OPTIONS xml_header = 'full'. How can I do that?

I have tried to use the SET_ENCODING methods of the if_ixml_istream and if_ixml_document objects like this:

l_encoding = l_ixml->create_encoding( byte_order ='1', character:_set = 'utf-8' ).

l_istream->set_encoding( encoding = l_encoding ).

and this still does not work.

Any idea how I can correctly render my xml to correctly display finnish characters?

BR,

Tony.