Message encoding

The default message encoding is recorded into the SMAT file so that the SMAT tool can default to it when the SMAT file is opened:

  • For inbound messages, the default message encoding is the thread encoding.
  • For outbound messages, the default message encoding is UTF-8.

In earlier versions, when a SMAT file was opened for the first time, the encoding defaulted to ASCII until changed by the user. After this was set, subsequent openings of the same file used the user’s encoding that is saved in the ecd file.

Now, opening a SMAT file checks if an ecd file exists. If it exists and the default encoding is found but the user encoding is not found, then the SMAT tool uses the engine default encoding. This encoding is saved as a user encoding in the ecd file. If both the engine default encoding and user encoding are found in the ecd file, then the user encoding is used.

This process shows the encoding defaults:

  1. Inbound message arrive with some encoding, for example, latin1.
  2. This is saved to the inbound SMAT in the same encoding in which it came, for example, latin1.
  3. The engine uses UTF-8 internally, so that the message is converted to UTF-8 in the engine.
  4. The message is written to the outbound SMAT in UTF-8, so that a resend sends in UTF-8 to the engine.
  5. The actual message going from the engine through the outbound protocol is what is specified in the outbound protocol thread, for example, latin1.