<?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 Character conversion: Unicode to non-unicode in Application Development and Automation Discussions</title>
    <link>https://community.sap.com/t5/application-development-and-automation-discussions/character-conversion-unicode-to-non-unicode/m-p/563928#M21706</link>
    <description>&lt;P&gt;There are lot of post on this subject. But none of them make clear to me how it works.&lt;/P&gt;
  &lt;P&gt;Data in SAP is maintained in Unicode format. But some external partners require the data to be converted into a different non-Unicode character set.&lt;/P&gt;
  &lt;P&gt;Example:&lt;/P&gt;
  &lt;P&gt;In SAP we have a character ß = C39F.&lt;/P&gt;
  &lt;P&gt;Our interface partner expects character set CP437. In this character set the code for character ß = E1.&lt;/P&gt;
  &lt;P&gt;So I expect SAP Unicode character C39F to be converted into character E1. &lt;/P&gt;
  &lt;P&gt;How to accomplish ?&lt;/P&gt;
  &lt;P&gt;Regards Jack&lt;/P&gt;
  &lt;PRE&gt;&lt;CODE&gt;lo_xml            = cl_ixml=&amp;gt;create( ).
lo_encoding       = lo_xml-&amp;gt;create_encoding( byte_order = 0 character_set = 'CP437' ).
lo_document       = lo_xml-&amp;gt;create_document( ).
lo_stream_factory = lo_xml-&amp;gt;create_stream_factory( ).
lo_stream         = lo_stream_factory-&amp;gt;create_ostream_xstring( lv_data ).
lo_stream-&amp;gt;set_encoding( lo_encoding ).
lo_renderer       = lo_xml-&amp;gt;create_renderer( ostream = lo_stream document = lo_document  ).
lo_element        = lo_document-&amp;gt;create_element_ns( `data` ).
lo_element-&amp;gt;set_attribute_ns( name = 'attribute' value = `AAAAßßßß` ).
lo_document-&amp;gt;append_child( lo_element ).
lo_renderer-&amp;gt;render( ).
&lt;/CODE&gt;&lt;/PRE&gt;</description>
    <pubDate>Thu, 02 Nov 2017 06:55:10 GMT</pubDate>
    <dc:creator>JackGraus</dc:creator>
    <dc:date>2017-11-02T06:55:10Z</dc:date>
    <item>
      <title>Character conversion: Unicode to non-unicode</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/character-conversion-unicode-to-non-unicode/m-p/563928#M21706</link>
      <description>&lt;P&gt;There are lot of post on this subject. But none of them make clear to me how it works.&lt;/P&gt;
  &lt;P&gt;Data in SAP is maintained in Unicode format. But some external partners require the data to be converted into a different non-Unicode character set.&lt;/P&gt;
  &lt;P&gt;Example:&lt;/P&gt;
  &lt;P&gt;In SAP we have a character ß = C39F.&lt;/P&gt;
  &lt;P&gt;Our interface partner expects character set CP437. In this character set the code for character ß = E1.&lt;/P&gt;
  &lt;P&gt;So I expect SAP Unicode character C39F to be converted into character E1. &lt;/P&gt;
  &lt;P&gt;How to accomplish ?&lt;/P&gt;
  &lt;P&gt;Regards Jack&lt;/P&gt;
  &lt;PRE&gt;&lt;CODE&gt;lo_xml            = cl_ixml=&amp;gt;create( ).
lo_encoding       = lo_xml-&amp;gt;create_encoding( byte_order = 0 character_set = 'CP437' ).
lo_document       = lo_xml-&amp;gt;create_document( ).
lo_stream_factory = lo_xml-&amp;gt;create_stream_factory( ).
lo_stream         = lo_stream_factory-&amp;gt;create_ostream_xstring( lv_data ).
lo_stream-&amp;gt;set_encoding( lo_encoding ).
lo_renderer       = lo_xml-&amp;gt;create_renderer( ostream = lo_stream document = lo_document  ).
lo_element        = lo_document-&amp;gt;create_element_ns( `data` ).
lo_element-&amp;gt;set_attribute_ns( name = 'attribute' value = `AAAAßßßß` ).
lo_document-&amp;gt;append_child( lo_element ).
lo_renderer-&amp;gt;render( ).
&lt;/CODE&gt;&lt;/PRE&gt;</description>
      <pubDate>Thu, 02 Nov 2017 06:55:10 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/character-conversion-unicode-to-non-unicode/m-p/563928#M21706</guid>
      <dc:creator>JackGraus</dc:creator>
      <dc:date>2017-11-02T06:55:10Z</dc:date>
    </item>
    <item>
      <title>Re: Character conversion: Unicode to non-unicode</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/character-conversion-unicode-to-non-unicode/m-p/563929#M21707</link>
      <description>&lt;P&gt; &lt;/P&gt;
  &lt;P&gt;Your code is correct, but a few code pages are not fully described in table TCP00A (Relationship between standardized name and SAP code page number). For instance, it would work with code page "iso-8859-1".&lt;/P&gt;
  &lt;P&gt; &lt;/P&gt;
  &lt;P&gt;To complete TCP00A, you may see an example with GB18030 in note &lt;A href="https://launchpad.support.sap.com/#/solutions/r/?type=note&amp;amp;route=notes&amp;amp;pos=0&amp;amp;p=%7B%22note%22%3A%221901768%22%7D"&gt;1901768 - code page undefined for gb18030&lt;/A&gt; .&lt;/P&gt;
  &lt;P&gt; &lt;/P&gt;
  &lt;P&gt;Go to transaction SCP. Enter code page 1107 (SAP code page for CP437).&lt;/P&gt;
  &lt;P&gt; &lt;/P&gt;
  &lt;P&gt;&lt;IMG class="migrated-image" src="https://community.sap.com/legacyfs/online/storage/attachments/storage/7/attachments/82265-run6e.png" /&gt;&lt;/P&gt;
  &lt;P&gt; &lt;/P&gt;
  &lt;P&gt;Change the code page.&lt;/P&gt;
  &lt;P&gt; &lt;/P&gt;
  &lt;P&gt;&lt;IMG class="migrated-image" src="https://community.sap.com/legacyfs/online/storage/attachments/storage/7/attachments/82266-kg9p6.png" /&gt;&lt;/P&gt;
  &lt;P&gt; &lt;/P&gt;
  &lt;P&gt;Add attribute H 0001 CP437 and SAVE.&lt;/P&gt;
  &lt;P&gt; &lt;/P&gt;
  &lt;P&gt;&lt;IMG class="migrated-image" src="https://community.sap.com/legacyfs/online/storage/attachments/storage/7/attachments/82267-94qy2.png" /&gt;&lt;/P&gt;
  &lt;P&gt; &lt;/P&gt;
  &lt;P&gt;Try your program again.&lt;/P&gt;
  &lt;P&gt;.&lt;/P&gt;
  &lt;P&gt;EDIT: the Eszett character is the Unicode character U+00DF. C39F is its code value in UTF-8. When you indicate an invalid or unknown encoding (in TCP00A), the encoding is ignored, so UTF-8 will be used with a rendering to an XSTRING variable.&lt;/P&gt;</description>
      <pubDate>Thu, 02 Nov 2017 07:43:44 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/character-conversion-unicode-to-non-unicode/m-p/563929#M21707</guid>
      <dc:creator>Sandra_Rossi</dc:creator>
      <dc:date>2017-11-02T07:43:44Z</dc:date>
    </item>
    <item>
      <title>Re: Character conversion: Unicode to non-unicode</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/character-conversion-unicode-to-non-unicode/m-p/563930#M21708</link>
      <description>&lt;P&gt;That solves the problem.&lt;/P&gt;
  &lt;P&gt;That also explain to me the missing link between code page and character set.&lt;/P&gt;
  &lt;P&gt;Most characters are now correctly converted into the destination character set. Characters that are missing are converted into the missing conversion character which is '#' by default. That is all fine.&lt;/P&gt;
  &lt;P&gt;A next conversion in the 'nice to have category' would be a conversion of character Ë. Character Ë is not available in the destination character set. So it gets converted into #. Nice to have is to have it converted into E. Do you know this is possible ?&lt;/P&gt;
  &lt;P&gt;Thanks and regards&lt;/P&gt;</description>
      <pubDate>Thu, 02 Nov 2017 08:29:03 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/character-conversion-unicode-to-non-unicode/m-p/563930#M21708</guid>
      <dc:creator>JackGraus</dc:creator>
      <dc:date>2017-11-02T08:29:03Z</dc:date>
    </item>
    <item>
      <title>Re: Character conversion: Unicode to non-unicode</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/character-conversion-unicode-to-non-unicode/m-p/563931#M21709</link>
      <description>&lt;P&gt;Sorry I missed your question (please use Comment instead of Answer so that I'm automatically informed, or copy/paste my name).&lt;/P&gt;&lt;P&gt;Yes it's possible with SCP, but it may be a little bit complex if you're not used to work with code pages. Another solution is to first replace the accentuated characters with the function module SCP_REPLACE_STRANGE_CHARS, then do the code page conversion.&lt;/P&gt;</description>
      <pubDate>Mon, 29 Apr 2019 15:18:30 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/character-conversion-unicode-to-non-unicode/m-p/563931#M21709</guid>
      <dc:creator>Sandra_Rossi</dc:creator>
      <dc:date>2019-04-29T15:18:30Z</dc:date>
    </item>
  </channel>
</rss>

