<?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: Convert HTTP_CLIENT_RECEIVE from UTF-16 to UTF-8 in Application Development and Automation Discussions</title>
    <link>https://community.sap.com/t5/application-development-and-automation-discussions/convert-http-client-receive-from-utf-16-to-utf-8/m-p/12598127#M2010765</link>
    <description>&lt;P&gt;Actually, I don't know if it is Big or Little ....&lt;/P&gt;</description>
    <pubDate>Wed, 01 Jun 2022 12:21:08 GMT</pubDate>
    <dc:creator>dimath72</dc:creator>
    <dc:date>2022-06-01T12:21:08Z</dc:date>
    <item>
      <title>Convert HTTP_CLIENT_RECEIVE from UTF-16 to UTF-8</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/convert-http-client-receive-from-utf-16-to-utf-8/m-p/12598122#M2010760</link>
      <description>&lt;P&gt;Dear Friends ,&lt;/P&gt;
  &lt;P&gt;I have made a program that call an API and the answer is in UTF-16 and I cannot handle it. I have searched many hours on the forum but I did;t managed to fix it.&lt;/P&gt;
  &lt;P&gt;Can you propose something?&lt;/P&gt;
  &lt;PRE&gt;&lt;CODE&gt;CALL METHOD P_HTTP_CLIENT-&amp;gt;RECEIVE&lt;BR /&gt;    EXCEPTIONS&lt;BR /&gt;      HTTP_COMMUNICATION_FAILURE = 1&lt;BR /&gt;      HTTP_INVALID_STATE         = 2&lt;BR /&gt;      HTTP_PROCESSING_FAILED     = 3&lt;BR /&gt;      OTHERS                     = 4.&lt;BR /&gt;&lt;BR /&gt;  P_P_CONTENT = P_HTTP_CLIENT-&amp;gt;RESPONSE-&amp;gt;GET_CDATA( ).&lt;BR /&gt;&lt;BR /&gt;  CALL FUNCTION 'SCMS_STRING_TO_XSTRING'&lt;BR /&gt;    EXPORTING&lt;BR /&gt;      TEXT   = P_P_CONTENT&lt;BR /&gt;    IMPORTING&lt;BR /&gt;      BUFFER = GV_XML_STRING&lt;BR /&gt;    EXCEPTIONS&lt;BR /&gt;      FAILED = 1&lt;BR /&gt;      OTHERS = 2.&lt;BR /&gt;&lt;BR /&gt;&lt;BR /&gt;  CALL FUNCTION 'SMUM_XML_PARSE'&lt;BR /&gt;    EXPORTING&lt;BR /&gt;     XML_INPUT = GV_XML_STRING&lt;BR /&gt;   TABLES&lt;BR /&gt;     XML_TABLE = GWA_XML_DATA&lt;BR /&gt;&lt;/CODE&gt;&lt;/PRE&gt;
  &lt;P&gt;Look the result that I take from server &lt;/P&gt;
  &lt;P&gt;&lt;IMG class="migrated-image" src="https://community.sap.com/legacyfs/online/storage/attachments/storage/7/attachments/2054937-image.png" /&gt;&lt;/P&gt;
  &lt;P&gt;And look the headers that I sent ....&lt;/P&gt;
  &lt;P&gt;&lt;IMG class="migrated-image" src="https://community.sap.com/legacyfs/online/storage/attachments/storage/7/attachments/2054938-image.png" /&gt;&lt;/P&gt;
  &lt;P&gt;Thanks a lot .....&lt;/P&gt;</description>
      <pubDate>Wed, 01 Jun 2022 10:37:38 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/convert-http-client-receive-from-utf-16-to-utf-8/m-p/12598122#M2010760</guid>
      <dc:creator>dimath72</dc:creator>
      <dc:date>2022-06-01T10:37:38Z</dc:date>
    </item>
    <item>
      <title>Re: Convert HTTP_CLIENT_RECEIVE from UTF-16 to UTF-8</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/convert-http-client-receive-from-utf-16-to-utf-8/m-p/12598123#M2010761</link>
      <description>&lt;P&gt;Hi,&lt;/P&gt;&lt;P&gt;please check class  cl_abap_conv_codepage, like &lt;/P&gt;&lt;PRE&gt;&lt;CODE&gt; cl_abap_conv_codepage=&amp;gt;create_in( CODEPAGE = 'UTF-16' )-&amp;gt;convert( l_xstr ) &lt;/CODE&gt;&lt;/PRE&gt;</description>
      <pubDate>Wed, 01 Jun 2022 10:50:30 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/convert-http-client-receive-from-utf-16-to-utf-8/m-p/12598123#M2010761</guid>
      <dc:creator>ThorstenHoefer</dc:creator>
      <dc:date>2022-06-01T10:50:30Z</dc:date>
    </item>
    <item>
      <title>Re: Convert HTTP_CLIENT_RECEIVE from UTF-16 to UTF-8</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/convert-http-client-receive-from-utf-16-to-utf-8/m-p/12598124#M2010762</link>
      <description>&lt;P&gt;Can you please provide an example ?&lt;/P&gt;</description>
      <pubDate>Wed, 01 Jun 2022 11:04:50 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/convert-http-client-receive-from-utf-16-to-utf-8/m-p/12598124#M2010762</guid>
      <dc:creator>dimath72</dc:creator>
      <dc:date>2022-06-01T11:04:50Z</dc:date>
    </item>
    <item>
      <title>Re: Convert HTTP_CLIENT_RECEIVE from UTF-16 to UTF-8</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/convert-http-client-receive-from-utf-16-to-utf-8/m-p/12598125#M2010763</link>
      <description>&lt;P&gt;I am in version 740. I dont have it ...&lt;/P&gt;</description>
      <pubDate>Wed, 01 Jun 2022 11:53:41 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/convert-http-client-receive-from-utf-16-to-utf-8/m-p/12598125#M2010763</guid>
      <dc:creator>dimath72</dc:creator>
      <dc:date>2022-06-01T11:53:41Z</dc:date>
    </item>
    <item>
      <title>Re: Convert HTTP_CLIENT_RECEIVE from UTF-16 to UTF-8</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/convert-http-client-receive-from-utf-16-to-utf-8/m-p/12598126#M2010764</link>
      <description>&lt;P&gt;Hi Dimitras,&lt;/P&gt;&lt;P&gt;Is the UTF-16 big endian or little endian?&lt;/P&gt;&lt;P&gt;Regards,&lt;/P&gt;&lt;P&gt;Ryan Crosby&lt;/P&gt;</description>
      <pubDate>Wed, 01 Jun 2022 12:04:36 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/convert-http-client-receive-from-utf-16-to-utf-8/m-p/12598126#M2010764</guid>
      <dc:creator>Ryan-Crosby</dc:creator>
      <dc:date>2022-06-01T12:04:36Z</dc:date>
    </item>
    <item>
      <title>Re: Convert HTTP_CLIENT_RECEIVE from UTF-16 to UTF-8</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/convert-http-client-receive-from-utf-16-to-utf-8/m-p/12598127#M2010765</link>
      <description>&lt;P&gt;Actually, I don't know if it is Big or Little ....&lt;/P&gt;</description>
      <pubDate>Wed, 01 Jun 2022 12:21:08 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/convert-http-client-receive-from-utf-16-to-utf-8/m-p/12598127#M2010765</guid>
      <dc:creator>dimath72</dc:creator>
      <dc:date>2022-06-01T12:21:08Z</dc:date>
    </item>
    <item>
      <title>Re: Convert HTTP_CLIENT_RECEIVE from UTF-16 to UTF-8</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/convert-http-client-receive-from-utf-16-to-utf-8/m-p/12598128#M2010766</link>
      <description>&lt;P&gt;Hi Dimitras,&lt;/P&gt;&lt;P&gt;You could try something like this for UTF-16LE (4102 for BE) - All parameters but one are mandatory so this is just a sample but you can tailor it however you want and see if it will work.  Also, if this does not work there are some system -&amp;gt; external and external -&amp;gt; system format classes you can try: CL_ABAP_CONV_IN_CE, CL_ABAP_CONV_OUT_CE.&lt;/P&gt;&lt;PRE&gt;&lt;CODE&gt;DATA: input TYPE xstring,
      output TYPE xstring,
      inused TYPE i,
      outused TYPE i,
      substed TYPE i,
      input_ends TYPE c,
      too_short TYPE c.
      

DATA(converter) = NEW cl_abap_conv_obj( incode = '4103' 
                                        outcode = '4110' ).
converter-&amp;gt;convert( EXPORTING
                      inbuff             = input
                      outbufflg          = 10485760 "10MB buffer limit
                    IMPORTING
                      outbuff            = output
                      inused             = inused
                      outused            = outused
                      substed            = substed
                      input_ends_in_char = input_ends
                      outbuff_too_short  = too_short  ).&lt;BR /&gt;&lt;/CODE&gt;&lt;/PRE&gt;&lt;P&gt;Regards,&lt;/P&gt;&lt;P&gt;Ryan Crosby&lt;/P&gt;</description>
      <pubDate>Wed, 01 Jun 2022 12:22:17 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/convert-http-client-receive-from-utf-16-to-utf-8/m-p/12598128#M2010766</guid>
      <dc:creator>Ryan-Crosby</dc:creator>
      <dc:date>2022-06-01T12:22:17Z</dc:date>
    </item>
    <item>
      <title>Re: Convert HTTP_CLIENT_RECEIVE from UTF-16 to UTF-8</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/convert-http-client-receive-from-utf-16-to-utf-8/m-p/12598129#M2010767</link>
      <description>&lt;P&gt;Thanks a lot!&lt;/P&gt;&lt;P&gt;Correct answer.&lt;/P&gt;&lt;P&gt;You help me very much.&lt;/P&gt;&lt;P&gt;P.S)Thanks all for the help/&lt;/P&gt;</description>
      <pubDate>Wed, 01 Jun 2022 12:45:20 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/convert-http-client-receive-from-utf-16-to-utf-8/m-p/12598129#M2010767</guid>
      <dc:creator>dimath72</dc:creator>
      <dc:date>2022-06-01T12:45:20Z</dc:date>
    </item>
    <item>
      <title>Re: Convert HTTP_CLIENT_RECEIVE from UTF-16 to UTF-8</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/convert-http-client-receive-from-utf-16-to-utf-8/m-p/12598130#M2010768</link>
      <description>&lt;P&gt;&lt;STRONG&gt;It's UTF-16LE (little endian)&lt;/STRONG&gt; because of order &amp;lt;# (where # is in fact the null byte in your case). If order was #&amp;lt; that would be big endian.&lt;/P&gt;&lt;P&gt;Note that if you define an XML transformation to process the XML, you would use GET_DATA instead of GET_CDATA, and you wouldn't need to care about the encoding/codepage.&lt;/P&gt;</description>
      <pubDate>Wed, 01 Jun 2022 16:37:54 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/convert-http-client-receive-from-utf-16-to-utf-8/m-p/12598130#M2010768</guid>
      <dc:creator>Sandra_Rossi</dc:creator>
      <dc:date>2022-06-01T16:37:54Z</dc:date>
    </item>
  </channel>
</rss>

