Skip to Content

Archived discussions are read-only. Learn more about SAP Q&A

How can I change an encoding of XML document (+)


The main idea:

>In ABAP, create XML document from external xml-file, parse it with iXML parser and use the data.

The problem:

>XML has windows-1251 encoding (its a cyrillic). (SAP code page 1504).

(get_value() ) I got the "### ###" symbols in my string variable. That is, all cyrillic symbols are replaced with '#' (other symbols are ok). The get_character_set() method of if_ixml_encoding for this document returns 'windows-1251'.  In other words - all works just fine except all cyrillic symbols are replaced with '#'.

I've loaded xml file into internal table, translating the codepage, and when I'm looking at contents of that table I see my cyrillic symbols ok. After that, I'm creating input stream from that table and creating my XML document with create_istream_itable( ) method. And once again, when I'm trying to read values of nodes, I'm receiving the symols '#'.

How can I change that encoding? How can I get a value of the node in encoding different from the encoding of the xml document. (I need 1500 encoding instead of 1504). Method set_character_set( ) is no good - it creates an ABAP error.

Please, help.

Thank you for reading and for your time.

Kind regards,

Kissel Konstantin.

Former Member
Not what you were looking for? View more on this topic or Ask a question