<?xml version="1.0" encoding="UTF-8"?>
<rss xmlns:content="http://purl.org/rss/1.0/modules/content/" xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#" xmlns:taxo="http://purl.org/rss/1.0/modules/taxonomy/" version="2.0">
  <channel>
    <title>topic Re: XML data encoding iso-8859-1 . Currently utf-16 is default encoding in Application Development and Automation Discussions</title>
    <link>https://community.sap.com/t5/application-development-and-automation-discussions/xml-data-encoding-iso-8859-1-currently-utf-16-is-default-encoding/m-p/2801942#M654311</link>
    <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Dear Laxman;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Any  Luck Dear?&lt;/P&gt;&lt;P&gt;I am in a same situation... please pass to me your solution.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Best Regards,&lt;/P&gt;&lt;P&gt;Aslam Riaz&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Wed, 21 Nov 2007 11:36:23 GMT</pubDate>
    <dc:creator>Former Member</dc:creator>
    <dc:date>2007-11-21T11:36:23Z</dc:date>
    <item>
      <title>XML data encoding iso-8859-1 . Currently utf-16 is default encoding</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/xml-data-encoding-iso-8859-1-currently-utf-16-is-default-encoding/m-p/2801941#M654310</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hello ABAP Gurus ,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Need a help from you .&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Scenario : We have SAP4.7 enterprise version which we have now converted to Unicode system . There is a BSP application which talks to an external web application (Non Unicode) thru HTTP protocol and sends data thru XML.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Problem : Problem is at the time when BSP application prepares the XML While preparing XML data , before converting to Unicode environment the encoding was "iso-8859-1" . But now after Unicode conversion , the encoding is "UTF-16".&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;The XML data looks like &lt;/P&gt;&lt;P&gt;&amp;lt;?xml version="1.0" encoding="utf-16"?&amp;gt;&amp;lt;DATA&amp;gt;&amp;lt;ACTION&amp;gt;CREATE_TICKET&amp;lt;/ACTION&amp;gt;&amp;lt;CRI&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I have tried replacing "utf-16" by "iso-8859-1 " . The interface works . But at the recieving end , ie external web application , the German umlauts appear as some garbage values .&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I know we need to enforce encoding . I have tried with the following code but could not suceed . The encoding appears as "utf-16".&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Following is the section of code which I have written in BSP application.&lt;/P&gt;&lt;UL&gt;&lt;LI level="1" type="ul"&gt;&lt;P&gt;  Daten in DOM-Baum wandeln&lt;/P&gt;&lt;/LI&gt;&lt;/UL&gt;&lt;P&gt;    CALL FUNCTION 'SDIXML_DATA_TO_DOM'&lt;/P&gt;&lt;P&gt;      EXPORTING&lt;/P&gt;&lt;P&gt;        name        = 'DATA'&lt;/P&gt;&lt;P&gt;        dataobject  = ls_cr_xml&lt;/P&gt;&lt;P&gt;      IMPORTING&lt;/P&gt;&lt;P&gt;        data_as_dom = if_dom&lt;/P&gt;&lt;P&gt;      CHANGING&lt;/P&gt;&lt;P&gt;        document    = if_document&lt;/P&gt;&lt;P&gt;      EXCEPTIONS&lt;/P&gt;&lt;P&gt;        OTHERS      = 1.&lt;/P&gt;&lt;P&gt;    IF sy-subrc NE 0.&lt;/P&gt;&lt;P&gt;      error_out text-f47 text-f48 space space.&lt;/P&gt;&lt;P&gt;    ENDIF.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;UL&gt;&lt;LI level="1" type="ul"&gt;&lt;P&gt;  DOM-Baum in Character-Stream wandeln&lt;/P&gt;&lt;/LI&gt;&lt;/UL&gt;&lt;P&gt;    if_pixml = cl_ixml=&amp;gt;create( ).&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;    IF if_pixml IS INITIAL.&lt;/P&gt;&lt;P&gt;      error_out text-f50 text-f53 space space.&lt;/P&gt;&lt;P&gt;    ENDIF.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;    if_pstreamfact = if_pixml-&amp;gt;create_stream_factory( ).&lt;/P&gt;&lt;P&gt;    IF if_pstreamfact IS INITIAL.&lt;/P&gt;&lt;P&gt;      error_out text-f51 text-f53 space space.&lt;/P&gt;&lt;P&gt;    ENDIF.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;    if_postream = if_pstreamfact-&amp;gt;create_ostream_cstring( string = xml_doc ).&lt;/P&gt;&lt;P&gt;    IF if_pstreamfact IS INITIAL.&lt;/P&gt;&lt;P&gt;      error_out text-f52 text-f53 space space.&lt;/P&gt;&lt;P&gt;    ENDIF.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;--&lt;/STRONG&gt;&lt;DEL&gt;&lt;STRONG&gt;&lt;/STRONG&gt;&lt;/DEL&gt;&lt;/P&gt;&lt;HR originaltext="----------" /&gt;Encoding--&lt;HR originaltext="----------------------------" /&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;data: gv_str type string.&lt;/P&gt;&lt;P&gt;data: gv_l_xml_encoding type ref to if_ixml_encoding.&lt;/P&gt;&lt;P&gt;data gv_l_resultb type boolean.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;gv_str = 'ISO-8859-1' .&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;clear gv_l_xml_encoding.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;      call method if_pixml-&amp;gt;create_encoding&lt;/P&gt;&lt;P&gt;        EXPORTING&lt;/P&gt;&lt;P&gt;          byte_order    = 0&lt;/P&gt;&lt;P&gt;          character_set = gv_str&lt;/P&gt;&lt;P&gt;        RECEIVING&lt;/P&gt;&lt;P&gt;          rval          = gv_l_xml_encoding.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;      clear gv_l_resultb.&lt;/P&gt;&lt;P&gt;      call method gv_l_xml_encoding-&amp;gt;set_character_set&lt;/P&gt;&lt;P&gt;        EXPORTING&lt;/P&gt;&lt;P&gt;          charset = gv_str&lt;/P&gt;&lt;P&gt;        RECEIVING&lt;/P&gt;&lt;P&gt;          rval    = gv_l_resultb.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;        call method if_document-&amp;gt;set_encoding&lt;/P&gt;&lt;P&gt;        EXPORTING&lt;/P&gt;&lt;P&gt;          encoding = gv_l_xml_encoding.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;----&lt;/STRONG&gt;&lt;/P&gt;&lt;HR originaltext="---" /&gt;Append child -&lt;HR originaltext="------------------------------" /&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;CALL METHOD if_document-&amp;gt;append_child&lt;/P&gt;&lt;P&gt;      EXPORTING&lt;/P&gt;&lt;P&gt;        new_child = if_dom&lt;/P&gt;&lt;P&gt;      RECEIVING&lt;/P&gt;&lt;P&gt;        rval      = lv_return.&lt;/P&gt;&lt;P&gt;    IF lv_return NE 0.&lt;/P&gt;&lt;P&gt;      error_out text-f47 text-f49 space space.&lt;/P&gt;&lt;P&gt;    ENDIF.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;--&lt;/STRONG&gt;&lt;DEL&gt;&lt;STRONG&gt;&lt;/STRONG&gt;&lt;/DEL&gt;&lt;/P&gt;&lt;HR originaltext="----" /&gt;Render the XML data to output stream--&lt;HR originaltext="-----" /&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;    CALL METHOD if_document-&amp;gt;render&lt;/P&gt;&lt;P&gt;      EXPORTING&lt;/P&gt;&lt;P&gt;        ostream = if_postream.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;After this section of code is executed , the variable xml_doc  gets filled up with XML data .&lt;/P&gt;&lt;P&gt;&amp;lt;?xml version="1.0" encoding="utf-16"?&amp;gt;&amp;lt;DATA&amp;gt;&amp;lt;ACTION&amp;gt;CREATE_TICKET&amp;lt;/ACTION&amp;gt;&amp;lt;CRI&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Can anybody help how to enforce encoding ?&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Regards,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Laxman Nayak.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Sun, 02 Sep 2007 11:29:33 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/xml-data-encoding-iso-8859-1-currently-utf-16-is-default-encoding/m-p/2801941#M654310</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2007-09-02T11:29:33Z</dc:date>
    </item>
    <item>
      <title>Re: XML data encoding iso-8859-1 . Currently utf-16 is default encoding</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/xml-data-encoding-iso-8859-1-currently-utf-16-is-default-encoding/m-p/2801942#M654311</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Dear Laxman;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Any  Luck Dear?&lt;/P&gt;&lt;P&gt;I am in a same situation... please pass to me your solution.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Best Regards,&lt;/P&gt;&lt;P&gt;Aslam Riaz&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 21 Nov 2007 11:36:23 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/xml-data-encoding-iso-8859-1-currently-utf-16-is-default-encoding/m-p/2801942#M654311</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2007-11-21T11:36:23Z</dc:date>
    </item>
    <item>
      <title>Re: XML data encoding iso-8859-1 . Currently utf-16 is default encoding</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/xml-data-encoding-iso-8859-1-currently-utf-16-is-default-encoding/m-p/2801943#M654312</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi Aslam Riaz,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Did you find any solution..?&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Kindly help me on this issue.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Thanks and Regards,&lt;/P&gt;&lt;P&gt;Shailaja Chityala&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 01 Aug 2014 08:27:57 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/xml-data-encoding-iso-8859-1-currently-utf-16-is-default-encoding/m-p/2801943#M654312</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2014-08-01T08:27:57Z</dc:date>
    </item>
  </channel>
</rss>

