WebSphere Message Broker, Version 8.0.0.7 Operating Systems: AIX, HP-Itanium, Linux, Solaris, Windows, z/OS

See information about the latest product version

cciUcsToMbs

Use this function to convert Universal Character Set (UCS) data to multibyte string data. This function is, typically, used only for formatting diagnostic messages. Normal processing is best done in UCS-2, which can represent all characters from all languages.

The sample code in BipSampPluginUtil.c contains more utilities for processing UCS-2 characters in a portable way.

Syntax

int cciUcsToMbs(
  int*           returnCode,
  const CciChar* ucsString,
  char*          mbString,
  int            mbStringLength,
  int            codePage);

Parameters

returnCode
The return code from the function (output).

Possible return codes are:
  • CCI_SUCCESS
  • CCI_BUFFER_TOO_SMALL
  • CCI_INV_CHARACTER
  • CCI_FAILURE
  • CCI_INV_CODEPAGE
ucsString
The string to be converted, expressed as UCS-2 Unicode (input).
mbString
The location of the resulting string (input). The string has a trailing byte of 0, just as the Unicode has a trailing CciChar of 0.
mbStringLength
The length (in bytes) of the buffer that you have provided (input). Each CciChar in the source string expands to one byte (for SBCS code pages), or up to not more than the code page's MB_CUR_MAX value (typically less than five bytes), which defines an upper limit of the buffer size required.
codePage
The code page of the resulting string (input). The value of the code page must be suitable for the compiler that you are using to compile the user-defined node.

For an ASCII system, a value of 1208 (meaning code page ibm-1208, which is UTF-8 Unicode) is a good choice if you are using cciUcsToMbs to convert string constants for processing by WebSphere® Message Broker. 1208 is appropriate for Linux, UNIX, and Windows.

On Linux and UNIX systems, nl_langinfo(CODEPAGE) gives you the code page that has been selected by the setlocale command.

On z/OS®, the default code page for WebSphere MQ, which is 500, must not be used. Instead, use a code page value of 1047.

Return values

The returnCode parameter is set to the converted length in bytes.

Notices | Trademarks | Downloads | Library | Support | Feedback

Copyright IBM Corporation 1999, 2016Copyright IBM Corporation 1999, 2016.

        
        Last updated:
        
        Last updated: 2016-05-23 14:47:32


Reference topicReference topic | Version 8.0.0.7 | as08556_