Character set conversion

Character set conversion is necessary when you send a message from one system to another system where the code pages are different. Code page conversion is used by:

You must set the MQMessage CharacterSet property to a supported character set value (CCSID).

WebSphere MQ Automation Classes for ActiveX uses conversion tables to perform character set conversion.

For example, to convert strings automatically to code page 437:

Dim msg As New MQMessage                 'Define a WebSphere MQ message
msg.CharacterSet = 437                 'Set code page required
msg.WriteString "A character string"'Put character string in message

The WriteString method receives the string data ("A character string" in the example above) as a Unicode string. It then converts this data from Unicode into code page 437 using the conversion table 34B001B5.TBL.

Characters in the Unicode string that are not supported by code page 437 are given the standard substitution character from code page 437.

In a similar manner, when you use the ReadString method, the incoming message has a character set established by the WebSphere MQ Message Descriptor (MQMD) value and there is a conversion from this code page into Unicode before it is passed back to your scripting language.