Author |
Message
|
ctsaltaf |
Posted: Fri Feb 17, 2006 3:24 am Post subject: Multi-byte character indicator |
|
|
Newbie
Joined: 27 Mar 2005 Posts: 7
|
Hi,
I am raising this query on behalf of my team member
We are having a unique problem in which using JMS we are sending message with UTF-8 encoding and at receivers end the messages are arriving okay but they have got two bytes at the begining of each messages which i feel is multi-byte character indicator since some of those special UTF-8 characters are represented by 2 bytes.
We are pumping out bytes from JMS and when we pump out in bytes only then those two extra bytes are coming else when we pump out as string, then receiving application does not like the way those special UTF-8 characters appear at their end.
Any one know how to solve this. Receiving application is MQSI application so we have a limitation in terms of receiving application cannot change.
We somehow needs to send the message with bytes pumping and without the two extra bytes which appear to be multi-byte character indicator on the beginging of message. Messages are send with RFH2 headers.
Please let us know your thoughts on this.
Regards
Altaf |
|
Back to top |
|
 |
fschofer |
Posted: Fri Feb 17, 2006 3:45 am Post subject: |
|
|
 Knight
Joined: 02 Jul 2001 Posts: 524 Location: Mainz, Germany
|
Hi,
please post a hexdump of you message using amqsbcg
Greetings
Frank |
|
Back to top |
|
 |
fjb_saper |
Posted: Fri Feb 17, 2006 4:57 am Post subject: |
|
|
 Grand High Poobah
Joined: 18 Nov 2003 Posts: 20756 Location: LI,NY
|
You do not need to use a UTF-8 message to talk to the broker(mqsi).
Just use a plain text message. The broker can translate from which ever CCSID you are sending (if you have extra translation tables you need to make them available to the broker).
You could just as well model the message payload for the broker...
Enjoy  _________________ MQ & Broker admin |
|
Back to top |
|
 |
ctsaltaf |
Posted: Sun Feb 19, 2006 9:24 pm Post subject: Multi-byte character indicator |
|
|
Newbie
Joined: 27 Mar 2005 Posts: 7
|
Thanks guys for all your responses.
Doing a bit of reserch we came to a conclusion that somehow we need to send the message in form of bytes without those two extra characters.
We have thought of a logic like
1) Read the file into a string
2) Convert the string into UTF-8 encoded (I am not sure of which method I can use to do that)
3) Send that encoded string in form of bytes on queue (without writeUTF method) ( may be use writeBytes)
Can you please suggest us if anyone can tell us what is the method which we can use to convert the string in UTF-8 encoded.
Thanks and regards
Altaf |
|
Back to top |
|
 |
fjb_saper |
Posted: Mon Feb 20, 2006 6:03 am Post subject: |
|
|
 Grand High Poobah
Joined: 18 Nov 2003 Posts: 20756 Location: LI,NY
|
The real question here is why do you need to convert to UTF-8 ?
As said the broker can handle any CCSID conversion, given the tables (which means all standard conversions are handled).
What does your application do ?
Enjoy  _________________ MQ & Broker admin |
|
Back to top |
|
 |
EddieA |
Posted: Mon Feb 20, 2006 9:17 am Post subject: |
|
|
 Jedi
Joined: 28 Jun 2001 Posts: 2453 Location: Los Angeles
|
Quote: |
but they have got two bytes at the begining of each messages which i feel is multi-byte character indicator |
No. That's the length of the data. It's there because you used writeUTF() (which has nothing at all to do with UTF-8) instead of writeString.
Cheers, _________________ Eddie Atherton
IBM Certified Solution Developer - WebSphere Message Broker V6.1
IBM Certified Solution Developer - WebSphere Message Broker V7.0 |
|
Back to top |
|
 |
|