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 IBM MQ Support » MQ and C#

Post new topic  Reply to topic
 MQ and C# « View previous topic :: View next topic » 
Author Message
mboldrin
PostPosted: Wed Aug 31, 2005 1:02 pm    Post subject: MQ and C# Reply with quote

Newbie

Joined: 31 Aug 2005
Posts: 3

I am new to MQ....
I am using some canned code (C# example from IBM) to put a message to a MQ queue. When I put the message into the queue, it appears in a double byte character format. Is there any way to convert it to single byte.
Back to top
View user's profile Send private message
csmith28
PostPosted: Wed Aug 31, 2005 1:11 pm    Post subject: Reply with quote

Grand Master

Joined: 15 Jul 2003
Posts: 1196
Location: Arizona

Please be more verbose about this issue.

WMQ Version?
Operating System Platform?
What sample script are you using to put the messages?
I am assuming amqsput.

What do you mean by "double byte character format"?

What are you using to browse the message once it reaches the Queue?
_________________
Yes, I am an agent of Satan but my duties are largely ceremonial.
Back to top
View user's profile Send private message
mboldrin
PostPosted: Thu Sep 01, 2005 4:27 am    Post subject: Reply with quote

Newbie

Joined: 31 Aug 2005
Posts: 3

WMQ Version?
Version: 5.3.0
Operating System Platform?
Windows
What sample script are you using to put the messages?
I am assuming amqsput.
basically I have set up a C# webservice in .NET to put messages to a queue
here is the important part.
mqMsg = new MQMessage();
mqMsg.WriteString(message);
mqMsg.Format = MQC.MQFMT_STRING; mqPutMsgOpts = new MQPutMessageOptions(); try
{
mqQueue.Put( mqMsg, mqPutMsgOpts);
}

What do you mean by "double byte character format"?
if I put a message into the queue such as test.
When it is in the queue it looks like "t.e.s.t" So a message of 4 charcter long becomes 8.

What are you using to browse the message once it reaches the Queue?
RFHUTIL and the MQ explorer

Thanks for any help, I have been messing around with changing the mpPurMsgOpts and the format of the message by changing it to MQC.MQFMT_NONE or using a UTF character set. But I have just been plugging in the dark.
Back to top
View user's profile Send private message
jefflowrey
PostPosted: Thu Sep 01, 2005 4:34 am    Post subject: Reply with quote

Grand Poobah

Joined: 16 Oct 2002
Posts: 19981

C# uses Unicode strings as default.

Unicode is a double-byte character standard.

Your code is doing what you are telling it to do.

It is *not* MQ.
_________________
I am *not* the model of the modern major general.
Back to top
View user's profile Send private message
zpat
PostPosted: Thu Sep 01, 2005 6:21 am    Post subject: Reply with quote

Jedi Council

Joined: 19 May 2001
Posts: 5866
Location: UK

The important thing is to set the MQMD.CCSID to match the format of the data in the message. Ie set an ASCII CCSID with ASCII data, or a suitable DBCS CCSID with DBCS data.

A well written program will issue MQGET with CONVERT and therefore the actual character set is not critical as long as it matches the character set id in the MQMD.

If you don't code a CCSID you get the QM default which is probably ASCII Windows.
Back to top
View user's profile Send private message
mboldrin
PostPosted: Thu Sep 01, 2005 12:14 pm    Post subject: Reply with quote

Newbie

Joined: 31 Aug 2005
Posts: 3

Thanks - that is the ticket
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 IBM MQ Support » MQ and C#
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.