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
See information about the latest product version
cciMbsToUcs
Use this function to convert multibyte string data to Universal Character Set (UCS).
Syntax
int cciMbsToUcs(
int* returnCode,
const char* mbString,
CciChar* ucsString,
int ucsStringLength,
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
- mbString
- The string to be converted, expressed as 'file code' (input).
- ucsString
- The location of the resulting UCS-2 Unicode string (input). This string has a trailing CciChar of 0, just as the mbString has a trailing byte of 0.
- ucsStringLength
- The length (in CciChar) of the buffer that you have provided (input). Each byte in mbString expands to not more than one CciChar character, and this defines an upper limit for the buffer size required.
- codePage
- The code page of the source 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 cciMbsToUcs to convert string constants for processing by WebSphere® Message Broker. 1208 is appropriate for Linux, UNIX, and Windows systems.
On Linux, UNIX systems, nl_langinfo(CODEPAGE) gives you the code page that has been selected by setlocale.
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 half-words (UCS-2 characters).