CodedCharSetId (MQLONG)
This field specifies the character set identifier of character data within the message body.
If this field is set to MQCCSI_Q_MGR when calling MQGET with MQGMO_CONVERT in the options, the
behavior is different between client and server applications. For server applications, the code page
used for character conversion is the CodedCharSetId
of the queue manager; for client applications, the code
page used for character conversion is the current locale code page.
For client applications, MQCCSI_Q_MGR is filled in, based on the locale of the client rather than the one on the queue manager. The exception to that rule is when you put a message to an IMS bridge queue; what is returned, in the CodedCharSetId
field of MQMD, is the CCSID of the queue manager.
You must not use the following special value:
- MQCCSI_APPL
- This results in an incorrect value in the
CodedCharSetId
field of the MQMD and causes a return code of MQRC_SOURCE_CCSID_ERROR (or MQRC_FORMAT_ERROR for z/OS® ) when the message is received using the MQGET call with the MQGMO_CONVERT option.
- MQCCSI_Q_MGR
- Character data in the message is in the queue manager's character set.
On the MQPUT and MQPUT1 calls, the queue manager changes this value in the MQMD that is sent with the message to the true character set identifier of the queue manager. As a result, the value MQCCSI_Q_MGR is never returned by the MQGET call.
- MQCCSI_DEFAULT
- The
CodedCharSetId
of the data in theString
field is defined by theCodedCharSetId
field in the header structure that precedes the MQCFH structure, or by theCodedCharSetId
field in the MQMD if the MQCFH is at the start of the message. - MQCCSI_INHERIT
- Character data in the message is in the same character set as this structure; this is the queue manager's character set. (For MQMD only, MQCCSI_INHERIT has the same meaning as MQCCSI_Q_MGR).
The queue manager changes this value in the MQMD that is sent with the message to the actual character set identifier of MQMD. Provided no error occurs, the value MQCCSI_INHERIT is not returned by the MQGET call.
Do not use MQCCSI_INHERIT if the value of the
PutApplType
field in MQMD is MQAT_BROKER. - MQCCSI_EMBEDDED
- Character data in the message is in a character set with the identifier that is contained within the message data itself. There can be any number of character set identifiers embedded within the message data, applying to different parts of the data. This value must be used for PCF messages (with a format of MQFMT_ADMIN, MQFMT_EVENT, or MQFMT_PCF) that contain data in a mixture of character sets. Each MQCFST, MQCFSL, and MQCFSF structure contained within the PCF message must have an explicit character set identifier specified and not MQCCSI_DEFAULT.
If a message of format MQFMT_EMBEDDED_PCF is to contain data in a mixture of character sets, do not use MQCCSI_EMBEDDED. Instead set MQEPH_CCSID_EMBEDDED in the Flags field in the MQEPH structure. This is equivalent to setting MQCCSI_EMBEDDED in the preceding structure. Each MQCFST, MQCFSL, and MQCFSF structure contained within the PCF message must then have an explicit character set identifier specified and not MQCCSI_DEFAULT. For more information on the MQEPH structure, see MQEPH - Embedded PCF header.
Specify this value only on the MQPUT and MQPUT1 calls. If it is specified on the MQGET call, it prevents conversion of the message.
On the MQPUT and MQPUT1 calls, the queue manager changes the values MQCCSI_Q_MGR and MQCCSI_INHERIT in the MQMD that is sent with the message as described above, but does not change the MQMD specified on the MQPUT or MQPUT1 call. No other check is carried out on the value specified.
Applications that retrieve messages must compare this field against the value the application is expecting; if the values differ, the application might need to convert character data in the message.
On z/OS, the Encoding
field of the MQMD is
used to specify the integer encoding of character data in the message body, when the
CodedCharSetId
field of the MQMD indicates that the representation of the character set is dependent on
the encoding used for binary integers. On Multiplatforms, the byte order of character data is assumed to be the same as the native integer encoding for the platform where the queue manager is running. This only affects certain multibyte character sets (for example UTF-16 character sets).
If you specify the MQGMO_CONVERT option on the MQGET call, this field is an input/output field. The value specified by the application is the coded character set identifier to which to convert the message data if necessary. If conversion is successful or unnecessary, the value is unchanged (except that the value MQCCSI_Q_MGR or MQCCSI_INHERIT is converted to the actual value). If conversion is unsuccessful, the value after the MQGET call represents the coded character set identifier of the unconverted message that is returned to the application.
Otherwise, this is an output field for the MQGET call, and an input field for the MQPUT and MQPUT1 calls. The initial value of this field is MQCCSI_Q_MGR.