IBM Support

IT34707: MQ classes for Java generated MQSTR format messages with messageproperties are always encoded in CCSID 1208

Subscribe to this APAR

By subscribing, you receive periodic emails alerting you to the status of the APAR, along with a link to the fix after it becomes available. You can track this item individually or track all items by product.

Notify me when this APAR changes.

Notify me when an APAR for this component changes.


APAR status

  • Closed as program error.

Error description

  • A Java application is using the MQ classes for Java to create
    and send an MQ message to a queue.
    The message being sent is:
      - The message body is comprised of character data, with a
    corresponding header format type specified as 'MQFMT_STRING'
      - The message contains a user defined message property
      - The application has configured the MQMD character encoding
    scheme, CodedCharSetId (CCSID), which is a value other than 1208
    When the message is inspected on the queue after being put by
    the application, it is observed that the message body has been
    encoded using the CCSID 1208 character encoding scheme, and not
    the expected value as specified by the application.

Local fix

Problem summary

  • ****************************************************************
    This issue affects users of the MQ classes for Java who are
    sending messages to an MQ queue/topic, where:
    (a) The message body is defined to be in the MQFMT_STRING
    (MQSTR) format
    (b) The message contains one or more user defined message
    (c) The application has specified a non-1208 CCSID for the
    message body encoding
    Platforms affected:
    When a Java application was putting a message to a queue, where:
      - The MQ Classes for Java API was being used to put the
      - The message body was defined to be in the MQFMT_STRING
    (MQSTR) format
      - The message contained user defined message properties
      - The application had specified that the message body text
    data was encoded in a CCSID other than 1208
    then the character text within the body of the message was
    encoded using CCSID 1208 (UTF-8), irrespective of what the
    application has specified as the encoding of the message.   The
    following code snippet demonstrates the issue:
      // Create a object instance
      MQMessage mqMessage = new MQMessage();
      // Define the message body as containing character data
      mqMessage.format = MQConstants.MQFMT_STRING;
      // Set the message body character encoding scheme as 37
    (IBM037 - US/Canada Latin 1 EBCDIC)
      mqMessage.characterSet = 37;
      // Add the message payload
      mqMessage.writeString("A message generated using the IBM MQ
    classes for Java.");
      // Include a user defined message property
    When this message is inspected on the queue, the body of the
    message was seen to be encoded in CCSID 1208 (UTF-8), and not
    the CCSID 37 which had been expected.
    It should be noted that the message is still a well formed MQ
    message - in that the RFH2 header which defined the CCSID of the
    message body correctly specified the message body as being
    encoded in CCSID 1208 - it is just not in the character encoding
    which the application had specified on the
    If the user defined message property is not set on the message,
    then the message body character data is encoded in the
    application requested CCSID, which would be CCSID 37 in the
    above example.

Problem conclusion

  • The MQ classes for Java API has been updated to provide a
    mechanism by which the CCSID of the message as configured by the
    application will be used as the character encoding for the body
    of the message.
    To avoid a change of behaviour being experienced by an existing
    application, this default value of this property is set to
    retain the existing behaviour - that is to say if a message
    property is included in the message, then the message body will
    be encoded in CCSID 1208.
    To enable this new behaviour where the message body is encoded
    using the specified CCSID, use the following Java System
    property and value:
    The fix is targeted for delivery in the following PTFs:
    Version    Maintenance Level
    v9.1 LTS
    v9.2 LTS
    v9.3 LTS
    v9.x CD    9.3.1
    The latest available maintenance can be obtained from
    'WebSphere MQ Recommended Fixes'
    If the maintenance level is not yet available information on
    its planned availability can be found in 'WebSphere MQ
    Planned Maintenance Release Dates'

Temporary fix


APAR Information

  • APAR number


  • Reported component name


  • Reported component ID


  • Reported release


  • Status


  • PE




  • Special Attention

    NoSpecatt / Xsystem

  • Submitted date


  • Closed date


  • Last modified date


  • APAR is sysrouted FROM one or more of the following:

  • APAR is sysrouted TO one or more of the following:

Fix information

  • Fixed component name


  • Fixed component ID


Applicable component levels

[{"Business Unit":{"code":"BU059","label":"IBM Software w\/o TPS"},"Product":{"code":"SSYHRD","label":"IBM MQ"},"Platform":[{"code":"PF025","label":"Platform Independent"}],"Version":"910","Line of Business":{"code":"LOB45","label":"Automation"}}]

Document Information

Modified date:
08 March 2023