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 » IBM MQ Java / JMS » C Sharp : Puts messge with spaces

Post new topic  Reply to topic
 C Sharp : Puts messge with spaces « View previous topic :: View next topic » 
Author Message
matuwe
PostPosted: Mon Dec 13, 2010 12:12 am    Post subject: C Sharp : Puts messge with spaces Reply with quote

Master

Joined: 05 Dec 2007
Posts: 296

Hi We have a C Sharp client that is putting messages into our MQ and when the message is read, every charecter is has a space. We tried putting a test message

Test and it come out as T e s t. What could be the cause of this. The put options used is MQOO_OUTPUT.

Code:

        _queue = _queueManager.AccessQueue(_queueName, MQC.MQOO_OUTPUT + MQC.MQOO_FAIL_IF_QUIESCING);
            _queueMessage = new MQMessage();
            _queueMessage.WriteString(message);
            _queueMessage.Format = MQC.MQFMT_String;

            _queue.Put(_queueMessage);

Back to top
View user's profile Send private message
Mr Butcher
PostPosted: Mon Dec 13, 2010 12:44 am    Post subject: Reply with quote

Padawan

Joined: 23 May 2005
Posts: 1716

IMHO this is related to the CCSID used. Looks like you use a double byte character set ?!? Check the CCSID used for putting / getting the message.....
_________________
Regards, Butcher
Back to top
View user's profile Send private message
matuwe
PostPosted: Mon Dec 13, 2010 12:48 am    Post subject: Reply with quote

Master

Joined: 05 Dec 2007
Posts: 296

The code page is comming in as 1200 and msgformat is MQSTR .

How can we change the CCSID to be 1208? I am doing a get using Message broker MQGet and I also tried RFHUtil to do the get.
Back to top
View user's profile Send private message
matuwe
PostPosted: Mon Dec 13, 2010 2:09 am    Post subject: Reply with quote

Master

Joined: 05 Dec 2007
Posts: 296

OKay we used the writeUTF("") and not the writeString("")

and now it works.
Back to top
View user's profile Send private message
mqjeff
PostPosted: Mon Dec 13, 2010 2:49 am    Post subject: Reply with quote

Grand Master

Joined: 25 Jun 2008
Posts: 17447

matuwe wrote:
OKay we used the writeUTF("") and not the writeString("")

and now it works.


No, now it's broken.

Codepage 1200 is UTF. Codepage 1208 is UTF. WriteUTF() is the wrong method to use.

When you are seeing "T E S T", what you are seeing is the fact that you have a double-byte character set, which 1200 is properly.
Back to top
View user's profile Send private message
fjb_saper
PostPosted: Mon Dec 13, 2010 6:11 am    Post subject: Reply with quote

Grand High Poobah

Joined: 18 Nov 2003
Posts: 20756
Location: LI,NY

matuwe wrote:
The code page is comming in as 1200 and msgformat is MQSTR .

How can we change the CCSID to be 1208? I am doing a get using Message broker MQGet and I also tried RFHUtil to do the get.

You are using message broker to do the Get (with an MQInput or MQGet node).
Make sure you DO NOT have the convert flag checked.
Make sure the CCSID on the MQMD/RFH is the correct one (corresponding to the content of the data)

Have fun
_________________
MQ & Broker admin
Back to top
View user's profile Send private message Send e-mail
mqjeff
PostPosted: Mon Dec 13, 2010 7:01 am    Post subject: Reply with quote

Grand Master

Joined: 25 Jun 2008
Posts: 17447

fjb_saper wrote:
Make sure you DO NOT have the convert flag checked.
Make sure the CCSID on the MQMD/RFH is the correct one (corresponding to the content of the data)




There are also some issues with MRM handling of the Byte Order Mark, so you may need to instruct Broker to process the data as a specific codepage (1201 or 1202 rather than the more generic 1200).
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 » IBM MQ Java / JMS » C Sharp : Puts messge with spaces
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.