Author |
Message
|
dk27 |
Posted: Tue Jul 07, 2009 3:54 am Post subject: Unicode conversion |
|
|
Acolyte
Joined: 28 Apr 2008 Posts: 51
|
I have a notepad saved encoding as unicode. It contains XML with come unicode characters. When I pass that file to broker through MQ. XML processing is failing.
To investigate, I stopped the flow and read the message through rfhutil and it seems that some special characters are appearing before the payload.
How can I remove these characters? |
|
Back to top |
|
 |
fjb_saper |
Posted: Tue Jul 07, 2009 3:57 am Post subject: Re: Unicode conversion |
|
|
 Grand High Poobah
Joined: 18 Nov 2003 Posts: 20756 Location: LI,NY
|
dk27 wrote: |
I have a notepad saved encoding as unicode. It contains XML with come unicode characters. When I pass that file to broker through MQ. XML processing is failing.
To investigate, I stopped the flow and read the message through rfhutil and it seems that some special characters are appearing before the payload.
How can I remove these characters? |
There was a discussion on the forum about CCSID that you might want to refer to. Some CCSIDs have endianness marked in the first 2 bytes of the message payload. Generally speaking you could probably use the readUTF method for those messages. Don't remove the bytes, have the sender specify the correct CCSID in the header! Have fun  _________________ MQ & Broker admin |
|
Back to top |
|
 |
dk27 |
Posted: Tue Jul 07, 2009 5:03 am Post subject: |
|
|
Acolyte
Joined: 28 Apr 2008 Posts: 51
|
I have mentioned correct ccsid in MQRFH2 - CCSID field as 1200 for unicode (UTF-16) also set conversion on channel to "Yes" and sent a message but it still fails in the message broker.
XML looks something like this:
<employee>
<name>9451$%ÁÄÈ</name>
<id>xyz793</id>
<project>gaa</project>
</employee>
So some special characters coming in the message. and because of that it is failing, how can I identify those and remove these if possible. |
|
Back to top |
|
 |
fschofer |
Posted: Tue Jul 07, 2009 5:17 am Post subject: |
|
|
 Knight
Joined: 02 Jul 2001 Posts: 524 Location: Mainz, Germany
|
From ih03 docu:
Quote: |
The code page field and the RFH encoding radio buttons should be used to select the desired byte ordering of the binary fields in the data that immediately follows the Rules and Formatting header.
The CCSID field is only used for a Rules and Formatting header that is in a version 2 format. This field denotes the code page used for the variable portion of the Rules and Formatting header. |
So within rfhutil you have to set the code page on the RFH tab if you are using a RFH header or the code page on the MQMD tab if not.
Greetings
Frank |
|
Back to top |
|
 |
dk27 |
Posted: Tue Jul 07, 2009 8:49 am Post subject: |
|
|
Acolyte
Joined: 28 Apr 2008 Posts: 51
|
This what I did and it is still failing... |
|
Back to top |
|
 |
fjb_saper |
Posted: Tue Jul 07, 2009 12:55 pm Post subject: |
|
|
 Grand High Poobah
Joined: 18 Nov 2003 Posts: 20756 Location: LI,NY
|
dk27 wrote: |
This what I did and it is still failing... |
Channel conversion should be set to NO! not yes.
And obviously you do not have the right ccsid if your message has an endianness indicator as the first 2 bytes.
1208 ccsid does not have that indicator....
 _________________ MQ & Broker admin |
|
Back to top |
|
 |
kimbert |
Posted: Wed Jul 08, 2009 12:45 am Post subject: |
|
|
 Jedi Council
Joined: 29 Jul 2003 Posts: 5542 Location: Southampton
|
I assume that you have already done the basic diagnostic steps:
1. disconnect the debugger
2. Insert Trace nodes
3. take a user trace
2. might not be useful in this particular case, but 1. and 3. are strongly advised whenever you get a non-trivial problem in your message flow. |
|
Back to top |
|
 |
|