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 » How to get message wehn it has multi language in xml

Post new topic  Reply to topic
 How to get message wehn it has multi language in xml « View previous topic :: View next topic » 
Author Message
xmqymshr
PostPosted: Thu Jul 14, 2016 12:33 pm    Post subject: How to get message wehn it has multi language in xml Reply with quote

Novice

Joined: 13 Jan 2016
Posts: 14

I am try to get an xml message with multi language values.So after executing the queue.Get the language is converted into ????????? . Below is my code. I tried to use character set 1208 which is utf8
Code:


                     queueMessage = new MQMessage { Format = MQC.MQFMT_STRING };
                       
                        queueMessage.CharacterSet = 1208;
                        queue.Get(queueMessage);
Back to top
View user's profile Send private message
smdavies99
PostPosted: Thu Jul 14, 2016 10:23 pm    Post subject: Reply with quote

Jedi Council

Joined: 10 Feb 2003
Posts: 6076
Location: Somewhere over the Rainbow this side of Never-never land.

a few things to consider/do.

1) browse the message and see what CCSID it was written in.
2) Verify using a utility such as amqsbcg that the HEX values in the message actually match the right characters in the Character Set Map for the CCSID that the message was sent using.
It might be that the sender put the message onto the queue with the data in one CCSID but set the message properties to indicate that it is actually a different CCSID.

3) the ?????? might be that the application you are using to view the data can't map it properly. 2) above can help you verify that.

4) Setting a CCSID on a GET Operation actually does nothing. MQ is designed to read the message and pass it to your app using the data in the message. IF the CCSID in the message does not match the data then you will get garbage.
Go back to the message that you are trying to read and make sure that it is 10000000% correctly written. IF it isn't then go back to the people who wrote it and get them to fix the problem. If for some reason they won't then you won't be able to read it correctly.

5) Finally, this (2) above) is not an uncommon thing. It can take some time to get your head around CCSID's and what they are all about. some of us have been working with them for years and years and it becomes second nature to us.
_________________
WMQ User since 1999
MQSI/WBI/WMB/'Thingy' User since 2002
Linux user since 1995

Every time you reinvent the wheel the more square it gets (anon). If in doubt think and investigate before you ask silly questions.
Back to top
View user's profile Send private message
mqjeff
PostPosted: Fri Jul 15, 2016 3:59 am    Post subject: Reply with quote

Grand Master

Joined: 25 Jun 2008
Posts: 17447

There are only a few specific codepages that XML is supposed to be written in..
Legal characters are tab, carriage return, line feed, and the legal characters of Unicode and ISO/IEC 10646.

In addition, the xml declaration needs to indicate what codepage the XML document is actually written in.

The MQ message needs to have the CCSID for the message set to the same codepage that the XML document is actually in.
_________________
chmod -R ugo-wx /
Back to top
View user's profile Send private message
tczielke
PostPosted: Fri Jul 15, 2016 4:10 am    Post subject: Reply with quote

Guardian

Joined: 08 Jul 2010
Posts: 939
Location: Illinois, USA

One other note. The MH06 supportpac has functionality in the mqtrcfrmt program called message parsing that will analyze a message as if it was 1208 (UTF8) or 1200 (UTF16) and then provide information on if any of the bytes of the message would be invalid for that assumed code page, are multi-byte, are surrogate pairs, and the offsets of where these identified bytes are located in the message. This can be helpful in investigating if a message was incorrectly labeled for certain CCSIDs. You can help validate either if a message was incorrectly labeled as 1208 or 1200, or if a 1200/1208 message was incorrectly labeled as another CCSID with this tool.
_________________
Working with MQ since 2010.
Back to top
View user's profile Send private message
fjb_saper
PostPosted: Fri Jul 15, 2016 5:36 am    Post subject: Reply with quote

Grand High Poobah

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

smdavies99 wrote:

4) Setting a CCSID on a GET Operation actually does nothing. MQ is designed to read the message and pass it to your app using the data in the message. IF the CCSID in the message does not match the data then you will get garbage.
Go back to the message that you are trying to read and make sure that it is 10000000% correctly written. IF it isn't then go back to the people who wrote it and get them to fix the problem. If for some reason they won't then you won't be able to read it correctly.

And here I thought that setting the CCSID on the message before the get operation, in conjunction with the convert flag, asked the queue manager to deliver the message in the requested CCSID if the format was MQFMT_STRING.

Of course this can only make sense if the message was created with the CCSID corresponding to the data it carries.
_________________
MQ & Broker admin
Back to top
View user's profile Send private message Send e-mail
smdavies99
PostPosted: Fri Jul 15, 2016 11:28 am    Post subject: Reply with quote

Jedi Council

Joined: 10 Feb 2003
Posts: 6076
Location: Somewhere over the Rainbow this side of Never-never land.

fjb_saper wrote:

And here I thought that setting the CCSID on the message before the get operation, in conjunction with the convert flag, asked the queue manager to deliver the message in the requested CCSID if the format was MQFMT_STRING.

Of course this can only make sense if the message was created with the CCSID corresponding to the data it carries.


You are right but in the sample supplied, there was no setting of the convert option.

Setting the convert option is IMHO the last option. IT can cause more problems than it solves but until we know more about the message then I would not want to get the OP going down route.
_________________
WMQ User since 1999
MQSI/WBI/WMB/'Thingy' User since 2002
Linux user since 1995

Every time you reinvent the wheel the more square it gets (anon). If in doubt think and investigate before you ask silly questions.
Back to top
View user's profile Send private message
xmqymshr
PostPosted: Fri Jul 15, 2016 11:49 am    Post subject: Reply with quote

Novice

Joined: 13 Jan 2016
Posts: 14

Thank you every one for taking a look. The problem was on the sender side the fixed the encoding to utf8 and then everything is running fine now. i did not had to change any thing on the receiver side
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 » How to get message wehn it has multi language in xml
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.