|
RSS Feed - WebSphere MQ Support
|
RSS Feed - Message Broker Support
|
 |
|
Unicode and Message Sets |
« View previous topic :: View next topic » |
Author |
Message
|
fazz |
Posted: Thu Mar 10, 2005 3:23 am Post subject: Unicode and Message Sets |
|
|
 Centurion
Joined: 20 Feb 2004 Posts: 144 Location: England
|
Hi All,
I have the need to convert data in messages into Unicode (1200) this is a double byte codepage.
When i map this to a message set it is failing on the integer data types. For string data I have changed the Length Units field to be Character Units, so it can work out how many bytes to read per char. For integers you cannot use this setting, it has to be Byte or End of Bitstream (both of which won't achieve what I need).
So i decided to change the Trailing Skip Count field to 2, so it skips 2 bytes after reading this field. I was informed when compliling that this feature is only availiable of v5 brokers!! I have a v5 broker!.
Anyway, am I barking up the completely wrong tree for supporting unicode in message sets?
Does anyone else have experience of this?
Any help would be greatly apprectiated.
Many Thanks
Simon |
|
Back to top |
|
 |
kimbert |
Posted: Fri Mar 11, 2005 2:39 am Post subject: |
|
|
 Jedi Council
Joined: 29 Jul 2003 Posts: 5542 Location: Southampton
|
Quote: |
For integers you cannot use this setting, it has to be Byte or End of Bitstream |
So your integers are not represented as strings in the bitstream. In that case, are you sure it is safe to convert them to a different code page?
Quote: |
So i decided to change the Trailing Skip Count field to 2, so it skips 2 bytes after reading this field |
Bad idea! The 'Trailing Skip Count' property is intended for word-alignment of structures, and is certainly not meant for dealing with your scenario.
The message about requiring a v5 broker is intended as a warning to 2.1 users. You can ignore it.
I'm still not quite sure whether your input message is in Unicode 1200, or whether you are trying to convert a non-Unicode message. Maybe you could clarify that. |
|
Back to top |
|
 |
fazz |
Posted: Fri Mar 11, 2005 3:20 am Post subject: |
|
|
 Centurion
Joined: 20 Feb 2004 Posts: 144 Location: England
|
Hi kimbert,
I believe the data will come in as a string, but the MRM definition for the field is an integer, so i presume an implicit cast is taking place.
I was originally trying to map a unicode message to an MRM, as this was causing so many problems I have now decided to map the original code page data to the MRM then change the CodeCharSet to 1200 (unicode) so the message is transformed on the way out.
This however does not work..it is giving this error:
Quote: |
ParserException BIP5171E: Custom Wire Format parsing error
An error occurred while parsing a Custom Wire Format message.
Current message : 'SEG_Z2EBO_PURCH_ORD_HEAD01000_V4'
Current element : '226^LINECNT'
Path from message root : '/SEG_Z2EBO_PURCH_ORD_HEAD01000_V4'
Offset from start of message : 100
See following errors for more details.
2005-03-10 16:38:45.019699 4916 ConversionException BIP5502E: A Common Parser Interface internal error occurred: Diagnostic information: 11.
An internal error occurred while reading from or writing to the bitstream.
If the problem persists, please contact your IBM support center. |
This is the field that it seems to be complaining about:
Quote: |
(0x03000000):LINECNT = 1 |
I can't see whats wrong with this, if I leave the CodedCharSet unchanged the flow works fine, just seems to fail when trying to convert to Unicode.
Thanks for replying  |
|
Back to top |
|
 |
kimbert |
Posted: Fri Mar 11, 2005 6:05 am Post subject: |
|
|
 Jedi Council
Joined: 29 Jul 2003 Posts: 5542 Location: Southampton
|
First thing you should be aware of is that all string data is converted to UTF-16 within the broker. This happens before parsing of any string data. This includes integers which are represented as strings in the bitstream.
Are you quite certain that your message model is correct? i.e. are the correct pieces of the input bitstream being assigned to the correct elements?
I'm still a little puzzled about what your scenario is. If your input data is in some 'other' code page, the string data will automatically be pre-converted to UTF-16, as described above. So it is not possible to 'map the original code page data'. |
|
Back to top |
|
 |
fazz |
Posted: Fri Mar 11, 2005 6:37 am Post subject: |
|
|
 Centurion
Joined: 20 Feb 2004 Posts: 144 Location: England
|
Well them problem now is the data maps correctly to the MRM and is output correctly if I leave the CodeCharSet unchanged, i.e. it comes in as 277 and goes out as 277.
If I change the CodeCharSet to be 1200 it gives the error I listed above when writing to the output queue. |
|
Back to top |
|
 |
contactop |
Posted: Fri Mar 18, 2005 4:45 am Post subject: |
|
|
Acolyte
Joined: 26 Jun 2003 Posts: 50
|
as the problem in in ur Integer type elements, i would suggest going with String datatype. |
|
Back to top |
|
 |
jfluitsm |
Posted: Tue Mar 22, 2005 12:23 am Post subject: |
|
|
Disciple
Joined: 24 Feb 2002 Posts: 160 Location: The Netherlands
|
Simon,
The best place for converting messages is at the destination using the CONVERT option and the correct ccsid.
If you want to output unicode, preferably use ccsid 1208 (utf- , in most instances this will give you unicode with shorter messages.
As already stated, the broker always convert text to unicode internally, so a convert on the MQInput is of no use.
For the failing integer, please check the physical properties, these should be set to 'external decimal', if the integer has a sign it should be seperated. _________________ Jan Fluitsma
IBM Certified Solution Designer WebSphere MQ V6
IBM Certified Solution Developer WebSphere Message Broker V6 |
|
Back to top |
|
 |
|
|
 |
|
Page 1 of 1 |
|
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
|
|
|
|