Author |
Message
|
matuwe |
Posted: Mon Dec 13, 2010 12:12 am Post subject: C Sharp : Puts messge with spaces |
|
|
 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 |
|
 |
Mr Butcher |
Posted: Mon Dec 13, 2010 12:44 am Post subject: |
|
|
 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 |
|
 |
matuwe |
Posted: Mon Dec 13, 2010 12:48 am Post subject: |
|
|
 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 |
|
 |
matuwe |
Posted: Mon Dec 13, 2010 2:09 am Post subject: |
|
|
 Master
Joined: 05 Dec 2007 Posts: 296
|
OKay we used the writeUTF("") and not the writeString("")
and now it works. |
|
Back to top |
|
 |
mqjeff |
Posted: Mon Dec 13, 2010 2:49 am Post subject: |
|
|
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 |
|
 |
fjb_saper |
Posted: Mon Dec 13, 2010 6:11 am Post subject: |
|
|
 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 |
|
 |
mqjeff |
Posted: Mon Dec 13, 2010 7:01 am Post subject: |
|
|
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 |
|
 |
|