<?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: SAP Unicode RFC types in Application Development and Automation Discussions</title>
    <link>https://community.sap.com/t5/application-development-and-automation-discussions/sap-unicode-rfc-types/m-p/1011618#M79040</link>
    <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;If you are using the non-Unicode RFC SDK, all four types basically typedef to char. So they basically represent one-byte character data like ISO-Latin-1, Micorsoft CP1252 etc, depending on the platform you run.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;If you are using the Unicode RFC SDK or the NetWeaver RFC SDK, then all four types represent platform-independent 2-byte UTF-16 data. On Windows they typedef to wchar_t (because Windows uses 2-byte UTF-16 as its Unicode representation), on Linux and most Unixes they typedef to a 2-byte unsigned short. (Which is different from wchar_t in most cases, as most Unixes use a 4-byte wchar_t.)&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Don't forget to compile you code with -DSAPwithUNICODE, otherwise you'll get segmentation fautls as the buffers you feed into the RFC APIs is only half as long as the RFC APIs expect them to be....&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;This is most convenient, of your program is Unicode anyway. However, if you program is processing non-Unicode data that it gets from other legacy libraries, databases, user input, etc, you first need to convert from your platform encoding to UTF-16, before passing the data to the RFC APIs. If you are running on Linux, where the platform is using UTF-8 as its default encoding, you can simply use the API RfcUTF8ToSAPUC() (and the corresponding RfcSAPUCToUTF8() for the other way around) to convert to the SAP_UC type (and back). (This API is available in the NetWeaver RFC SDK.)&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;If you are dealing with let's say ISO-Latin-1 for example, you could use standard GNU functions iconv_open() and iconv() to convert from ISO-Latin-1 to UTF-16. (Giving a pointer to a SAP_UC[] as "outbuf" in the iconv() call.)  See [http://pubs.opengroup.org/onlinepubs/009695399/functions/iconv.html|http://pubs.opengroup.org/onlinepubs/009695399/functions/iconv.html]  and also&lt;/P&gt;&lt;P&gt;[http://www.gnu.org/software/libiconv/|http://www.gnu.org/software/libiconv/]&lt;/P&gt;&lt;P&gt;I think libiconv is available on all Unixes and Linux distributions these days.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;On Windows we have the MultiByteToWideChar(), WideCharToMultiByte(), etc functions, which convert to wchar_t and back. (Despite their name, they can handle single-byte codepages like CP1252 as well....)&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Best Regards, Ulrich&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Wed, 13 Apr 2011 14:33:10 GMT</pubDate>
    <dc:creator>Ulrich_Schmidt1</dc:creator>
    <dc:date>2011-04-13T14:33:10Z</dc:date>
    <item>
      <title>SAP Unicode RFC types</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/sap-unicode-rfc-types/m-p/1011617#M79039</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Could anybody provide clear definitions and usage examples for the following 'character' types in the SAP RFCSDK (in addition to the comments in the source code:)?&lt;/P&gt;&lt;P&gt;- rfc_char_t&lt;/P&gt;&lt;P&gt;- SAP_CHAR&lt;/P&gt;&lt;P&gt;- SAP_UC&lt;/P&gt;&lt;P&gt;- RFC_CHAR&lt;/P&gt;&lt;P&gt;- ?&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 27 Sep 2005 22:48:48 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/sap-unicode-rfc-types/m-p/1011617#M79039</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2005-09-27T22:48:48Z</dc:date>
    </item>
    <item>
      <title>Re: SAP Unicode RFC types</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/sap-unicode-rfc-types/m-p/1011618#M79040</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;If you are using the non-Unicode RFC SDK, all four types basically typedef to char. So they basically represent one-byte character data like ISO-Latin-1, Micorsoft CP1252 etc, depending on the platform you run.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;If you are using the Unicode RFC SDK or the NetWeaver RFC SDK, then all four types represent platform-independent 2-byte UTF-16 data. On Windows they typedef to wchar_t (because Windows uses 2-byte UTF-16 as its Unicode representation), on Linux and most Unixes they typedef to a 2-byte unsigned short. (Which is different from wchar_t in most cases, as most Unixes use a 4-byte wchar_t.)&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Don't forget to compile you code with -DSAPwithUNICODE, otherwise you'll get segmentation fautls as the buffers you feed into the RFC APIs is only half as long as the RFC APIs expect them to be....&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;This is most convenient, of your program is Unicode anyway. However, if you program is processing non-Unicode data that it gets from other legacy libraries, databases, user input, etc, you first need to convert from your platform encoding to UTF-16, before passing the data to the RFC APIs. If you are running on Linux, where the platform is using UTF-8 as its default encoding, you can simply use the API RfcUTF8ToSAPUC() (and the corresponding RfcSAPUCToUTF8() for the other way around) to convert to the SAP_UC type (and back). (This API is available in the NetWeaver RFC SDK.)&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;If you are dealing with let's say ISO-Latin-1 for example, you could use standard GNU functions iconv_open() and iconv() to convert from ISO-Latin-1 to UTF-16. (Giving a pointer to a SAP_UC[] as "outbuf" in the iconv() call.)  See [http://pubs.opengroup.org/onlinepubs/009695399/functions/iconv.html|http://pubs.opengroup.org/onlinepubs/009695399/functions/iconv.html]  and also&lt;/P&gt;&lt;P&gt;[http://www.gnu.org/software/libiconv/|http://www.gnu.org/software/libiconv/]&lt;/P&gt;&lt;P&gt;I think libiconv is available on all Unixes and Linux distributions these days.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;On Windows we have the MultiByteToWideChar(), WideCharToMultiByte(), etc functions, which convert to wchar_t and back. (Despite their name, they can handle single-byte codepages like CP1252 as well....)&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Best Regards, Ulrich&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 13 Apr 2011 14:33:10 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/sap-unicode-rfc-types/m-p/1011618#M79040</guid>
      <dc:creator>Ulrich_Schmidt1</dc:creator>
      <dc:date>2011-04-13T14:33:10Z</dc:date>
    </item>
  </channel>
</rss>

