|
RSS Feed - WebSphere MQ Support
|
RSS Feed - Message Broker Support
|
 |
|
Empty bytes in message - Urgent |
« View previous topic :: View next topic » |
Author |
Message
|
tergo |
Posted: Wed Feb 11, 2004 12:26 pm Post subject: Empty bytes in message - Urgent |
|
|
Newbie
Joined: 11 Feb 2004 Posts: 1
|
Help! In VB.Net, the System.String datatype is inherently Unicode, whereas in VB6 it was inherently ASCII. Here is the problem:
If you take the following 3 characters and write it to a queue without .Net, if you examine the message in hexadecimal you will see:
The string we are writing in: XHO
The hexadecimal representation: 58 48 4F
Data length: 3
However, if you take the same 'XHO' string, but this time from VB.Net via IBM.WMQ, and write it to a queue you get:
The string we are writing in: XHO
The hexadecimal representation: 58 00 48 00 4F 00
Data length: 6
When Websphere sees the Unicode, he pads each character with an extra empty byte. Does anyone know of a way to prevent this from occurring? Or alternatively, does anyone know how to write the message into the queue byte for byte instead of using a string? |
|
Back to top |
|
 |
JasonE |
Posted: Wed Feb 11, 2004 1:56 pm Post subject: |
|
|
Grand Master
Joined: 03 Nov 2003 Posts: 1220 Location: Hursley
|
Set the characterset of the message to a non-unicode value, and use writestring. Eg nmqsput modified as follows:
Quote: |
mqMsg = new MQMessage();
mqMsg.CharacterSet = 850; <** added
mqMsg.WriteString( message ); |
Mind you, as long as the FORMAT is set to MQSTR and the CCSID is unicode, if the getter uses convert it should convert it ok anyway |
|
Back to top |
|
 |
|
|
 |
|
Page 1 of 1 |
|
You cannot post new topics in this forum You cannot reply to topics in this forum You cannot edit your posts in this forum You cannot delete your posts in this forum You cannot vote in polls in this forum
|
|
|
|