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

set_encoding seems to have no efect

Former Member
0 Likes
781

Hello!

I am porting an aplication from 4.6c to 6.0 and now im am having trubles with XML files.

I use them to send data to an intermidiate server and at the part where i am creating the xml document it seems like the part of the source code has no effect at the xml file.

DATA:

l_encoding TYPE REF TO if_ixml_encoding.

gobj_ixml = cl_ixml=>create( ).

gobj_document = gobj_ixml->create_document( ).

l_encoding = gobj_ixml->create_encoding( character_set = 'utf-8'

byte_order = 0 ).

CALL METHOD gobj_document->set_encoding( encoding = l_encoding ).

The created files allways start with:

Switch from current encoding to specified encoding not supported.

Please help me!

<?xml version="1.0" encoding="utf-16"?>

The problem is that the file is encoded in UTF-8 but the head of the file says it is UTF-16 and the target sistem then responds with this error:

Edited by: Ales Vrabic on Jun 24, 2008 11:22 AM

1 ACCEPTED SOLUTION
Read only

Former Member
0 Likes
728

a wild guess.... want to try "utf-8" (double ")

Hello!

I am porting an aplication from 4.6c to 6.0 and now im am having trubles with XML files.

I use them to send data to an intermidiate server and at the part where i am creating the xml document it seems like the part of the source code has no effect at the xml file.

DATA:

l_encoding TYPE REF TO if_ixml_encoding.

gobj_ixml = cl_ixml=>create( ).

gobj_document = gobj_ixml->create_document( ).

l_encoding = gobj_ixml->create_encoding( character_set = 'utf-8'

byte_order = 0 ).

CALL METHOD gobj_document->set_encoding( encoding = l_encoding ).

The created files allways start with:

Switch from current encoding to specified encoding not supported.

Please help me!

<?xml version="1.0" encoding="utf-16"?>

The problem is that the file is encoded in UTF-8 but the head of the file says it is UTF-16 and the target sistem then responds with this error:

Edited by: Ales Vrabic on Jun 24, 2008 11:22 AM

3 REPLIES 3
Read only

Former Member
0 Likes
729

a wild guess.... want to try "utf-8" (double ")

Read only

0 Likes
728

no effect

Read only

0 Likes
728

I have the same problem. Eventhough the program have set_encoding statement using UTF-8, it is always generated with UTF-16. Do you manage to find the solution?

Regards,

Abraham