WebSphere Message Brokers
File: as08556_
Writer: Lorraine Waitt

Reference topic

This build: July 31, 2007 21:38:21

cciUcsToMbs

Converts Universal Character Set (UCS) data to multi-byte 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 (BipSampPluginUtil.c) shows 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 should be suitable for the compiler that is being used 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 and UNIX, and for Windows platforms.

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

For OS/390 and z/OS, the default code page for WebSphere MQ, which is 500, should not be used. Instead, you should use a code page value of 1047.

Return values

The converted length in bytes.

Notices | Trademarks | Downloads | Library | Support | Feedback

Copyright IBM Corporation 1999, 2007Copyright IBM Corporation 1999, 2007. All Rights Reserved.
This build: July 31, 2007 21:38:21

as08556_ This topic's URL is: