Home

 

Double-byte character sets

Publication data can use a single-byte character set (SBCS) or a double-byte character set (DBCS) code page. However, if a publishing application publishes information in SBCS, a subscribing application receiving that information must not request the data to be converted to DBCS (because the MQRFH header would be converted as well, and the header must be SBCS).

Figure 16. Publication data after the RFH structure. In this example, the publication data ($112.85) that is being published as string data in MQSTR format, is appended to the message after the NameValueString. Note that the RFH StrucLength includes the NameValueString, but not the publication data. The message descriptor defines the encoding, CCSID and format of the RFH structure, which in turn defines the encoding, CCSID and format of the publication data.

Figure 17. Publishing data within the NameValueString. Publication data can be included within the NameValueString, by means of one or more user-defined name/value pairs, as shown in this example. The encoding and CCSID fields in the RFH structure are not set, because there is no following data. The receiving application must parse the RFH structure to extract the publication data.

Figure 18. User-defined publication data. In this example, the format of the publication data is set to a user-defined format, ACCOUNT, which contains character and numeric data. When the broker processes Publish messages, it converts the RFH header (but not the publication data) to its own CCSID and encoding. The user must write a data conversion routine if the publication is sent to subscribing applications that use a different CCSID or encoding.

In the previous examples, it is assumed that the subscribing or publishing application is running in an explicit code page of 437. However, for reasons of portability, applications can use the special CCSID value MQCCSI_Q_MGR in the message descriptor if they are using the same code page as the queue manager they are communicating with. In addition, the special value MQCCSI_INHERIT can be set in the CCSID field of the RF header to indicate that the publication data is in the same CCSID as the character data in the header.

Figure 19 shows how the CCSID for the RF header and the publication data can be inherited from the message descriptor.

Figure 19. Inheriting the CCSID. The message descriptor uses the special value MQCCSI_Q_MGR to indicate that data within the RFH structure is in the same CCSID as the queue manager. The value of MQCCSI_INHERIT in the RFH structure indicates that the same CCSID is used for the publication data.



 

Home