ASG
IBM
Zystems
Cressida
Icon
Netflexity
 
  MQSeries.net
Search  Search       Tech Exchange      Education      Certifications      Library      Info Center      SupportPacs      LinkedIn  Search  Search                                                                   FAQ  FAQ   Usergroups  Usergroups
 
Register  ::  Log in Log in to check your private messages
 
RSS Feed - WebSphere MQ Support RSS Feed - Message Broker Support

MQSeries.net Forum Index » General Discussion » Empty bytes in message - Urgent

Post new topic  Reply to topic
 Empty bytes in message - Urgent « View previous topic :: View next topic » 
Author Message
tergo
PostPosted: Wed Feb 11, 2004 12:26 pm    Post subject: Empty bytes in message - Urgent Reply with quote

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
View user's profile Send private message
JasonE
PostPosted: Wed Feb 11, 2004 1:56 pm    Post subject: Reply with quote

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
View user's profile Send private message
Display posts from previous:   
Post new topic  Reply to topic Page 1 of 1

MQSeries.net Forum Index » General Discussion » Empty bytes in message - Urgent
Jump to:  



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
Protected by Anti-Spam ACP
 
 


Theme by Dustin Baccetti
Powered by phpBB © 2001, 2002 phpBB Group

Copyright © MQSeries.net. All rights reserved.