Author |
Message
|
DTechBuddy |
Posted: Wed Mar 28, 2012 6:11 am Post subject: Does MQ support mesaages in french language |
|
|
Novice
Joined: 05 May 2009 Posts: 20
|
Hello,
My current CCSID for distributed queue manager is 819 and 37 for Z/os Queue manager.
how do i achieve synchronous communication between the distributed and z/os queuemanger without manipulation of messages.
currently all french characters are replaced by dots eg (..) for Z/os and (.) for distributed queue mangers respectively. |
|
Back to top |
|
 |
Vitor |
Posted: Wed Mar 28, 2012 6:16 am Post subject: Re: Does MQ support mesaages in french language |
|
|
 Grand High Poobah
Joined: 11 Nov 2005 Posts: 26093 Location: Texas, USA
|
DTechBuddy wrote: |
how do i achieve synchronous communication between the distributed and z/os queuemanger without manipulation of messages. |
You'll at least need to manipulate them from one code page to another. The WMQ convert facilities will do this.
DTechBuddy wrote: |
currently all french characters are replaced by dots eg (..) for Z/os and (.) for distributed queue mangers respectively. |
Are you sure they're replaced by dots, or is what you're using to view the messages just showing them as dots? Use a tool that shows the actual hex value in the message and see if it's the value of a dot character, or the value of the french character in one code page or the other. _________________ Honesty is the best policy.
Insanity is the best defence. |
|
Back to top |
|
 |
DTechBuddy |
Posted: Wed Mar 28, 2012 6:24 am Post subject: |
|
|
Novice
Joined: 05 May 2009 Posts: 20
|
By one code page to another you mean i need to manipulate the CCSID for every message being sent from application?
currently they are using 819 setting on their JBOSS server. |
|
Back to top |
|
 |
Vitor |
Posted: Wed Mar 28, 2012 6:32 am Post subject: |
|
|
 Grand High Poobah
Joined: 11 Nov 2005 Posts: 26093 Location: Texas, USA
|
DTechBuddy wrote: |
By one code page to another you mean i need to manipulate the CCSID for every message being sent from application? |
No. The CCSID of every message must be the code page in which the message is coded or this all falls apart round you. You (or the application) should use the WMQ facilties to convert the message payload from one code page to another or the application should accept the payload, read the encoding and make it's own arrangements.
Note that changing the CCSID of the message by simply poking the value doesn't do anything except cause the value not to match the payload, which is a short road to disaster as I indicate above. _________________ Honesty is the best policy.
Insanity is the best defence. |
|
Back to top |
|
 |
DTechBuddy |
Posted: Wed Mar 28, 2012 7:14 am Post subject: |
|
|
Novice
Joined: 05 May 2009 Posts: 20
|
Thank you so much for the explanation.
Now, when an application(java) tries to send the message to another application(mainframe/java) the default CCSID or code page used in our architecture here is 819 (for distributed applications).
Example
pmo = new MQPutMessageOptions(); // accept the defaults, same
sndMessage.messageId = msgId;
sndMessage.correlationId = MQC.MQMI_NONE;
sndMessage.encoding = MQC.MQENC_NATIVE;
sndMessage.characterSet = MQC.MQCCSI_Q_MGR;
do i need to change my encoding and character set accordingly for french messages at both sending and receving end.
how do i acheive my goal.
thank you so much for your help. Thank again.... |
|
Back to top |
|
 |
mqjeff |
Posted: Wed Mar 28, 2012 7:18 am Post subject: |
|
|
Grand Master
Joined: 25 Jun 2008 Posts: 17447
|
You should set the sndMessage.encoding and sndMessage.CharacterSet to values that correctly represent the data in the message.
If you are randomly setting it to 819 because the queue manager happens to be using 819, that is the wrong thing to do.
If you are reading data from a web form that is using UTF-8 to represent French characters, then you should set the sndMessage.characterSet to a UTF-8 value, not to the queue manager's CCSID.
You do not need to change the queue manager's CCSID.
You do not need to change the receiving application.
You need to fix the broken sending application. |
|
Back to top |
|
 |
Vitor |
Posted: Wed Mar 28, 2012 7:23 am Post subject: |
|
|
 Grand High Poobah
Joined: 11 Nov 2005 Posts: 26093 Location: Texas, USA
|
mqjeff wrote: |
You should set the sndMessage.encoding and sndMessage.CharacterSet to values that correctly represent the data in the message. |
This is exactly what I was trying to explain.
mqjeff wrote: |
You need to fix the broken sending application. |
How do you know that this:
Code: |
sndMessage.characterSet = MQC.MQCCSI_Q_MGR; |
is the correct value for the payload? It might be, but doesn't sound like it is. You can't assume that the message payload is using the queue manager's code page as my most worthy associate points out. _________________ Honesty is the best policy.
Insanity is the best defence. |
|
Back to top |
|
 |
DTechBuddy |
Posted: Wed Mar 28, 2012 9:01 am Post subject: |
|
|
Novice
Joined: 05 May 2009 Posts: 20
|
Thank you all.....
i tried all kinds of options while sending a message from a test apllication.
you were exactly right its the tool which is showing dots(..) but the data is consistent.......
what i did is translated a paragraph from google translator and send it thru JMS using appropraite message option.
Now w/o setting any encoding and charset i am getting a proper response.
does this mean that CCSID or code page 819 is capable of handling french messages?
Any Idea.....
thank you once again.... |
|
Back to top |
|
 |
Vitor |
Posted: Wed Mar 28, 2012 9:10 am Post subject: |
|
|
 Grand High Poobah
Joined: 11 Nov 2005 Posts: 26093 Location: Texas, USA
|
DTechBuddy wrote: |
does this mean that CCSID or code page 819 is capable of handling french messages? |
This is the wrong way to think about this. There is no such thing as a french message; there is only payload. A message such as yours contains French characters which are not part of the "normal" ASCII / EBCDIC set so to correctly represent such characters you need a code page which contains a hex value that maps to these characters.
A little research on your part will reveal that 819, in common with a number of European code pages, has support for these characters. As my most worthy associate points out UTF-8 is another one. But you shouldn't cling to 819 as "the code page for French messages" especially as it's possible that a target for such a message may be unwilling or unable to use that code page. I offer into evidence your message reading tool, which couldn't correctly handle this & defaulted to dots.
With code pages, it's all about the hex. _________________ Honesty is the best policy.
Insanity is the best defence. |
|
Back to top |
|
 |
rekarm01 |
Posted: Wed Mar 28, 2012 9:37 am Post subject: Re: Does MQ support mesaages in french language |
|
|
Grand Master
Joined: 25 Jun 2008 Posts: 1415
|
DTechBuddy wrote: |
Code: |
pmo = new MQPutMessageOptions(); // accept the defaults, same
sndMessage.messageId = msgId;
sndMessage.correlationId = MQC.MQMI_NONE;
sndMessage.encoding = MQC.MQENC_NATIVE;
sndMessage.characterSet = MQC.MQCCSI_Q_MGR; |
|
This looks like Java, not JMS. Where is the rest of the code, that sets the format and writes the data into the message? Some of the Java MQMessage read/write methods use the given characterSet to automatically convert the data on read/write, and some don't.
DTechBuddy wrote: |
does this mean that CCSID or code page 819 is capable of handling french messages? |
The character set for ccsid 819 (ISO/IEC 8859-1) supports most French characters, but not all of them; for example, it doesn't support 'Œ', 'œ', 'Ÿ', or '€'. If that's an issue, use another ccsid, such as 1208 (UTF-8). |
|
Back to top |
|
 |
DTechBuddy |
Posted: Wed Mar 28, 2012 10:32 am Post subject: |
|
|
Novice
Joined: 05 May 2009 Posts: 20
|
i was using RHFutil to test the messages and found out the dots (..) in the messages.
For testing every aspect of this i wrote a test program to see how encoding and charset works.
I got the point that payload should have a proper code page attached with it so the target can encode it accordingly.
thank you all for your help.
Thanks again..... |
|
Back to top |
|
 |
bruce2359 |
Posted: Wed Mar 28, 2012 11:36 am Post subject: |
|
|
 Poobah
Joined: 05 Jan 2008 Posts: 9469 Location: US: west coast, almost. Otherwise, enroute.
|
DTechBuddy wrote: |
I got the point that payload should have a proper code page attached with it so the target can encode it accordingly. |
For clarity, the app does NOT attach the code-page to the message.
For clarity, the creating app usually populates the application payload in the CCSID of the qmgr. The app populates the MQMD with MQCCSI_Q_MGR.
The receiving app usually specifies MQGMO_CONVERT; and, if necessary (CCSID of sender qmgr /= CCSID of receiver qmgr) the message will be converted to the CCSID of the destination qmgr. _________________ I like deadlines. I like to wave as they pass by.
ב''ה
Lex Orandi, Lex Credendi, Lex Vivendi. As we Worship, So we Believe, So we Live. |
|
Back to top |
|
 |
PeterPotkay |
Posted: Wed Mar 28, 2012 12:46 pm Post subject: |
|
|
 Poobah
Joined: 15 May 2001 Posts: 7722
|
bruce2359 wrote: |
DTechBuddy wrote: |
I got the point that payload should have a proper code page attached with it so the target can encode it accordingly. |
For clarity, the app does NOT attach the code-page to the message.
For clarity, the creating app usually populates the application payload in the CCSID of the qmgr. The app populates the MQMD with MQCCSI_Q_MGR.
|
Apps DO specify the code page in the MQMD. They can choose the variable that says use the QM's CCSID. This only makes sense if the app and the QM run on the same server, and the app happens to produce a message buffer which would correctly be described by the CCSID the QM may be using. There's nothing preventing the app from producing a message buffer whose correct CCSID is different than what the QM happens to be using.
For MQ Client applications, that variable that says use the QM CCSID, it really gets switched around under the covers by the MQ Client libraries and the CCSID of the platform the MQ Client app is running is used, NOT the CCSID that the QM is using. _________________ Peter Potkay
Keep Calm and MQ On |
|
Back to top |
|
 |
bruce2359 |
Posted: Wed Mar 28, 2012 1:07 pm Post subject: |
|
|
 Poobah
Joined: 05 Jan 2008 Posts: 9469 Location: US: west coast, almost. Otherwise, enroute.
|
PeterPotkay wrote: |
Apps DO specify the code page in the MQMD. |
From my reading, the OP believes that the CCSID field of the MQMD determines the CCSID of the app payload. Not the case. The app can load any combination of hex characters in the payload. Did I misread?
The CCSID field of the MQMD is used to communicate the CCSID of the payload, not determine it.
What I was getting at in my reply is that apps can set the code-page to some other (any other) CCSID than that of the o/s and qmgr, though this is not the usual (most common) behavior. _________________ I like deadlines. I like to wave as they pass by.
ב''ה
Lex Orandi, Lex Credendi, Lex Vivendi. As we Worship, So we Believe, So we Live. |
|
Back to top |
|
 |
fjb_saper |
Posted: Wed Mar 28, 2012 10:10 pm Post subject: |
|
|
 Grand High Poobah
Joined: 18 Nov 2003 Posts: 20756 Location: LI,NY
|
bruce2359 wrote: |
From my reading, the OP believes that the CCSID field of the MQMD determines the CCSID of the app payload. Not the case. The app can load any combination of hex characters in the payload. Did I misread?
The CCSID field of the MQMD is used to communicate the CCSID of the payload, not determine it. |
It should be really easy for you to understand where the confusion comes from. As this is especially true in C it is less intuitive in java where all text representations are unicode, until serialized for output to a file or a message. At that point a conversion may well happen behind the scenes dictated by the CCSID of the qmgrobject / handle, of the message or the queue connection factory or the Destination (JMS)...
Have fun  _________________ MQ & Broker admin |
|
Back to top |
|
 |
|