Author |
Message
|
kevinmark99 |
Posted: Tue Apr 02, 2013 5:29 am Post subject: Changing the Input from western Europen to Utf-8 |
|
|
Newbie
Joined: 29 Mar 2013 Posts: 8
|
I have used the following code
question1 on ABISTREAM-> the encoding,ccsid which we give as parameters shd they be of the originating source or desired data format
Code: |
SET Environment.Variables.InputMsg = ASBITSTREAM(InputRoot.XMLNSC ENCODING 546 CCSID 1208 OPTIONS FolderBitStream);
SET Environment.Variables.InputMsg = CAST(Environment.Variables.InputMsg AS CHARACTER CCSID 1208 ENCODING 546);
CREATE LASTCHILD OF OutputRoot DOMAIN('XMLNSC') PARSE(Environment.Variables.InputMsg, 546, 1208);
SET OutputRoot.Properties.CodedCharSetId = 1208;
SET OutputRoot.MQMD.Encoding = 546;
SET OutputRoot.MQMD.CodedCharSetId = 1208;
|
I can see at the last debug point that it got converted into UTF-8 and the problem is when i put in the queue and see it in app watch i can see that they get changed to
Encoding : 546 CodedCharSetId : 437
question2:Even when we enforce its encoding and ccsid why does it change when it enters the queue?? |
|
Back to top |
|
 |
lancelotlinc |
Posted: Tue Apr 02, 2013 5:35 am Post subject: |
|
|
 Jedi Knight
Joined: 22 Mar 2010 Posts: 4941 Location: Bloomington, IL USA
|
|
Back to top |
|
 |
kevinmark99 |
Posted: Tue Apr 02, 2013 5:39 am Post subject: |
|
|
Newbie
Joined: 29 Mar 2013 Posts: 8
|
This is on Qmgr
CCSID 819
Im a newbie..i saw this in appwatch please tell me if anything u need so that i can somehow findout |
|
Back to top |
|
 |
smdavies99 |
Posted: Tue Apr 02, 2013 6:05 am Post subject: |
|
|
 Jedi Council
Joined: 10 Feb 2003 Posts: 6076 Location: Somewhere over the Rainbow this side of Never-never land.
|
Now think what would happen if someone coded their application to write data to the Queue with CCSID=500.
Sadly most app developers don't have a clue what CCSID they are using and what the implications are if they get it wrong or even worse when the CCSID specified does not match the CCSID of the data.
My general rule of thumb is to make (if at all possible) all Qmgrs use CCSID=1208.
If you did that you would prpbably find a fewer number of problems relating to CCSID.
Quite why IBM still stick with non UTF CCSID as the queue manager defaults is another issue entirely. _________________ 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 |
|
 |
kevinmark99 |
Posted: Tue Apr 02, 2013 6:44 am Post subject: |
|
|
Newbie
Joined: 29 Mar 2013 Posts: 8
|
What do u think will be the solution in my case...to change Qmanager defaults..??
I was thinking overriding will usually takes precedence over defaults..
can u tell me is there any other ways other than changing the default Q mgr ccsid? |
|
Back to top |
|
 |
rekarm01 |
Posted: Wed Apr 03, 2013 12:42 am Post subject: Re: Changing the Input from western Europen to Utf-8 |
|
|
Grand Master
Joined: 25 Jun 2008 Posts: 1415
|
kevinmark99 wrote: |
Code: |
SET Environment.Variables.InputMsg = ASBITSTREAM(InputRoot.XMLNSC ENCODING 546 CCSID 1208 OPTIONS FolderBitStream);
SET Environment.Variables.InputMsg = CAST(Environment.Variables.InputMsg AS CHARACTER CCSID 1208 ENCODING 546);
CREATE LASTCHILD OF OutputRoot DOMAIN('XMLNSC') PARSE(Environment.Variables.InputMsg, 546, 1208); |
|
This appears to convert from CHARACTER to UTF-8 back to CHARACTER again. There's no reason to do that. A simple SET statement would have the same net effect:
Code: |
SET OutputRoot.XMLNSC = InputRoot.XMLNSC; |
The XML parsers already convert, using the input ccsid when copying data from the input bitstream to the message tree, and using the output ccsid when copying data from the message tree to the output bitstream.
kevinmark99 wrote: |
Code: |
SET OutputRoot.Properties.CodedCharSetId = 1208;
SET OutputRoot.MQMD.Encoding = 546;
SET OutputRoot.MQMD.CodedCharSetId = 1208;
|
I can see at the last debug point that it got converted into UTF-8 and the problem is when i put in the queue and see it in app watch i can see that they get changed to
Encoding : 546 CodedCharSetId : 437 |
Make sure that AppWatch is not configured to convert the message when browsing the output queue.
kevinmark99 wrote: |
can u tell me is there any other ways other than changing the default Q mgr ccsid? |
The qmgr ccsid is probably not relevant here. |
|
Back to top |
|
 |
zpat |
Posted: Wed Apr 03, 2013 1:02 am Post subject: |
|
|
 Jedi Council
Joined: 19 May 2001 Posts: 5866 Location: UK
|
437 is your PC's codepage.
Look at the message unconverted.
Most tools convert it automatically when they MQGET the message but you can usually disable this. |
|
Back to top |
|
 |
|