Author |
Message
|
rexita |
Posted: Fri Oct 07, 2011 3:51 am Post subject: Parsing € in UNIX box is giving an error for the ISO-8859-1 |
|
|
Newbie
Joined: 06 Oct 2011 Posts: 4
|
I am not able to convert the € symbol on the Unix Broker machine,The broker uses the ISO-8859-1 std and CSSID is 819,However i read that 819 will not convert the euro symbol into the respective code,Kindly help me  |
|
Back to top |
|
 |
rexita |
Posted: Fri Oct 07, 2011 4:09 am Post subject: parsing error |
|
|
Newbie
Joined: 06 Oct 2011 Posts: 4
|
"You really need the message to be sent in a code page that supports all the needed characters."
Can you please explain what does the above mentioned sentence mean??? |
|
Back to top |
|
 |
smdavies99 |
Posted: Fri Oct 07, 2011 4:24 am Post subject: Re: Parsing € in UNIX box is giving an error for the ISO-885 |
|
|
 Jedi Council
Joined: 10 Feb 2003 Posts: 6076 Location: Somewhere over the Rainbow this side of Never-never land.
|
rexita wrote: |
I am not able to convert the € symbol on the Unix Broker machine,The broker uses the ISO-8859-1 std and CSSID is 819,However i read that 819 will not convert the euro symbol into the respective code,Kindly help me  |
Please see my earlier post in this thread.
ISO-8859-1 does not and never will support the use of the Euro Symbol.
You need to send the original message in a Character set that includes the support for the € symbol. If you don't then you won't get the right result.
Kimbert's first rule of CharacterSet conversion/coding says:-
You can't 'properly' fix wrongly coded data.
His Second rule is:-
Fix the SENDER rather than spending hours in Broker trying to Bodge it. _________________ 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 |
|
 |
rexita |
Posted: Fri Oct 07, 2011 4:46 am Post subject: |
|
|
Newbie
Joined: 06 Oct 2011 Posts: 4
|
The sender is a mainframe machine,
The following are the things i have done:
DECLARE inCCSID INT 923;
DECLARE inEncoding INT InputRoot.Properties.Encoding;
--Convert it into BLOB
DECLARE msgBitStream1 BLOB ASBITSTREAM(InputRoot.XML CCSID inCCSID ENCODING inEncoding);
--DECLARE msgBitStream1 BLOB InputRoot.BLOB.BLOB;
--Convert BLOB into Sequence Character
DECLARE msgChar CHAR CAST(msgBitStream1 AS CHAR CCSID 923 ENCODING inEncoding);
CREATE LASTCHILD OF OutputRoot DOMAIN('XML') PARSE(msgBitStream1,inEncoding,inCCSID);
I have set the character code set as u mentioned but still i am not able to get it working .Kindly tel me whicg is the CCSID that i am supposed to use and is this code correct ? as i am new to this technology |
|
Back to top |
|
 |
mqjeff |
Posted: Fri Oct 07, 2011 4:49 am Post subject: |
|
|
Grand Master
Joined: 25 Jun 2008 Posts: 17447
|
If you are new to this technology, I will tell you right now to STOP using InputRoot.XML.
Use the XMLNSC domain for all XML data, do not use the XML domain.
If you do not understand what I've just said, then you need to stop doing any message broker development and start reading the documentation until you DO understand what I just said. I am not saying this to be cruel or to be mean, I am stating facts.
You have been told a few times that you SHOULD NOT FIX THIS in Broker.
You are still trying to fix this in Broker.
You need to CHANGE THE SENDING APPLICATION ON THE MAINFRAME. It *needs* to specify *the correct* setting. |
|
Back to top |
|
 |
Vitor |
Posted: Fri Oct 07, 2011 4:52 am Post subject: |
|
|
 Grand High Poobah
Joined: 11 Nov 2005 Posts: 26093 Location: Texas, USA
|
Split from this to improve clarity and becuase it's a slightly different issue. _________________ Honesty is the best policy.
Insanity is the best defence. |
|
Back to top |
|
 |
Vitor |
Posted: Fri Oct 07, 2011 4:54 am Post subject: |
|
|
 Grand High Poobah
Joined: 11 Nov 2005 Posts: 26093 Location: Texas, USA
|
mqjeff wrote: |
If you are new to this technology, I will tell you right now to STOP using InputRoot.XML.
Use the XMLNSC domain for all XML data, do not use the XML domain. |
mqjeff wrote: |
You need to CHANGE THE SENDING APPLICATION ON THE MAINFRAME. It *needs* to specify *the correct* setting. |
 _________________ Honesty is the best policy.
Insanity is the best defence. |
|
Back to top |
|
 |
joebuckeye |
Posted: Fri Oct 07, 2011 6:36 am Post subject: |
|
|
 Partisan
Joined: 24 Aug 2007 Posts: 365 Location: Columbus, OH
|
rexita wrote: |
DECLARE inCCSID INT 923;
DECLARE inEncoding INT InputRoot.Properties.Encoding;
Kindly tel me whicg is the CCSID that i am supposed to use and is this code correct ? as i am new to this technology |
Well you are using the Encoding from the input message, why aren't you using the CCSID from the input message?
You need to read in the input data in the CCSID that the message was actually written in, not what you want it to be. The input message will tell you what CCSID to use.
And as others have said, stay away from the XML parser. Use XMLNSC. |
|
Back to top |
|
 |
smdavies99 |
Posted: Fri Oct 07, 2011 6:49 am Post subject: |
|
|
 Jedi Council
Joined: 10 Feb 2003 Posts: 6076 Location: Somewhere over the Rainbow this side of Never-never land.
|
Go back to first principals.....
Check that the message being sent from the MF is being sent with a CCSID that includes support for the Euro Symbol
Then check that no implicit conversion is being done by an intermediate QM on any channels.
Then AND ONLY THEN start messing with your flow.
You really need to be sure that the data being presented to your flow is 1000000% correct othewise Kimbert's 1st Law will apply.
As others have found, you need to make sure that the tool you are using to view the data is also capable of handing different CCSID's. If it isn't then you have to fall back upon the actual HEX value and and online Code page converter such as http://en.wikipedia.org/wiki/ISO/IEC_8859-15#Codepage_layout.
If you don't do this you could easily be fooled by false positives. Like Fools Gold really. _________________ 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 |
|
 |
rekarm01 |
Posted: Sun Oct 09, 2011 3:43 pm Post subject: Re: Parsing € in UNIX box is giving an error for the ISO-885 |
|
|
Grand Master
Joined: 25 Jun 2008 Posts: 1415
|
rexita wrote: |
"You really need the message to be sent in a code page that supports all the needed characters."
Can you please explain what does the above mentioned sentence mean? |
A code page specifies a fixed set of characters, and assigns a unique integer value to each character in the specified character set. A code page does not assign a value to any other characters. An application needs to assign a value to every character in a message, in order to convert it from characters to bytes.
rexita wrote: |
The broker uses the ISO-8859-1 std and CSSID is 819 |
What does that mean? Which CCSID is 819? A message flow does not have to use the default qmgr ccsid to read/write a message. Normally, the sending application specifies the input ccsid that the message flow uses to read its input message; the message flow can only specify the output ccsid that it uses to write its output message.
rexita wrote: |
i read that 819 will not convert the euro symbol into the respective code, Kindly help me |
That's correct. 819 won't work, so don't use it to write a message with a euro symbol. Generally:- When an application writes a message, it should use a character encoding (ccsid) that recognizes all of the characters in the message, to convert chars->bytes.
- When an application reads a message, it should use the same character encoding (ccsid) that the writer used to write it, to convert bytes->chars.
Check every component along the message path that converts on read/write:- What ccsid does the mainframe application use to write the message? Does the mainframe ccsid recognize the euro symbol? Does the mainframe application include the same ccsid as part of the message?
- Is there anything between the mainframe and message flow that might convert the message from one ccsid to another, such as an WMQ channel, or MQInput node? If so, does the resulting ccsid recognize the euro symbol? Does the converting component include the resulting ccsid as part of the message?
- Does the message flow need to convert the message from one ccsid (input ccsid) to another (output ccsid)? If so, does the resulting ccsid recognize the euro symbol? Does the message flow include the output ccsid as part of the message?
|
|
Back to top |
|
 |
|