Application Development and Automation Discussions
Join the discussions or start your own on all things application development, including tools and APIs, programming models, and keeping your skills sharp.
cancel
Showing results for 
Search instead for 
Did you mean: 
Read only

Cannot get encoding correct using ABAP XML

Former Member
0 Likes
615

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.

1 REPLY 1
Read only

Former Member
0 Likes
399

Ever managed to get this done?

Tried "UTF-8" in capitals?

Ciao

Alex