Author |
Message
|
mqlover |
Posted: Sun Sep 19, 2010 11:21 pm Post subject: Encoding Arabic characters |
|
|
Disciple
Joined: 25 Jul 2010 Posts: 176
|
Hi,
I have to map some arabic characters getting from backend to my OutputRoot.
I have written two statements in my ESQL.
SET OutputRoot.Properties.CodedCharSetId='1208';
set OutputRoot.Properties.ContentType='UTF-8';
After this I am hardcoding some Arabic name as follows :
SET OutputRoot.XMLNSC.ArabicName = 'للإشتراك';
But I am unable to save the ESQL file because of the reason
"Some characters cannot be mapped using "Cp1252" cahracter encoding".
I searched in the forum but did not find the appropriate answer.
Does any1 has any idea about this?
Thanks |
|
Back to top |
|
 |
mqjeff |
Posted: Mon Sep 20, 2010 1:22 am Post subject: |
|
|
Grand Master
Joined: 25 Jun 2008 Posts: 17447
|
You are setting the CodedCharSetId to the wrong thing. You are setting it to a CHARACTER value and not to an INTEGER value. |
|
Back to top |
|
 |
rekarm01 |
Posted: Mon Sep 20, 2010 1:32 am Post subject: Re: Encoding Arabic characters |
|
|
Grand Master
Joined: 25 Jun 2008 Posts: 1415
|
mqlover wrote: |
But I am unable to save the ESQL file because of the reason
"Some characters cannot be mapped using "Cp1252" cahracter encoding". |
Check the "Text file encoding" in the toolkit editor preferences. |
|
Back to top |
|
 |
mqlover |
Posted: Mon Sep 20, 2010 5:33 am Post subject: Encoding Arabic characters |
|
|
Disciple
Joined: 25 Jul 2010 Posts: 176
|
Yeah as its mentioned i changed the "Text File Encoding" to UTF-8.
Thanks |
|
Back to top |
|
 |
mqlover |
Posted: Mon Sep 20, 2010 5:48 am Post subject: Encoding Arabic characters |
|
|
Disciple
Joined: 25 Jul 2010 Posts: 176
|
Hi I have set the OutputRoot.Properties.CodedCharSetId=437
But I am getting the exception as Parser exception and the reason is "Unconvertable character".
Does any1 have any idea about encoding this Arabic characters.
Thanks |
|
Back to top |
|
 |
mqjeff |
Posted: Mon Sep 20, 2010 5:55 am Post subject: Re: Encoding Arabic characters |
|
|
Grand Master
Joined: 25 Jun 2008 Posts: 17447
|
mqlover wrote: |
Hi I have set the OutputRoot.Properties.CodedCharSetId=437 |
That is at least a numerical value, and not a 'string' value.
The CodedCharSetID needs to a) be a NUMBER, and not a STRING, b) correctly represent the CodedCharSetID of the DATA in the message.
Your arabic characters are certainly not in Windows Ascii, which is 437.
They might be in 1208, but this is NOT the same as '1208'.
If you've changed the Text File Encoding to UTF-8, then using 1200 or 1208 is a good start. |
|
Back to top |
|
 |
mqlover |
Posted: Tue Sep 21, 2010 2:55 am Post subject: Encoding Arabic characters |
|
|
Disciple
Joined: 25 Jul 2010 Posts: 176
|
Hi,
As told i have used the following statements
SET OutputRoot.MQMD.CodedCharSetId=1208;
set OutputRoot.Properties.ContentType='UTF-8';
The message is going to the output queue. But when I browse the message using MQ Explorer I can see those Arabic characters as some special characters. Is it problem with MQ Explorer which cannot read these Arabic characters or because of me setting CCSID in MQMD header has changed the message?
Should I browse the message using some other tool like rfhutil n all?
Can any1 throw some light on this? |
|
Back to top |
|
 |
mqjeff |
Posted: Tue Sep 21, 2010 4:16 am Post subject: |
|
|
Grand Master
Joined: 25 Jun 2008 Posts: 17447
|
UTF-8 is a multi-byte character set. |
|
Back to top |
|
 |
BCBS |
Posted: Tue Sep 21, 2010 4:25 pm Post subject: |
|
|
 Apprentice
Joined: 12 Jul 2006 Posts: 37
|
mqlover wrote: |
Should I browse the message using some other tool like rfhutil n all? |
Have you tried before asking? It takes less time to browse than type that question here.
When using RFHUtil, do a browse and save the file to local drive, and then open the message using some text editor like 'EDITPLUS'. Make sure to delete the extra characters saved as part of the message since you used RFHUtil (at the very beginning till the actual data start). _________________ _________________________________ |
|
Back to top |
|
 |
balu2608 |
Posted: Sat Mar 02, 2013 9:47 pm Post subject: |
|
|
 Apprentice
Joined: 18 May 2012 Posts: 39
|
Hi Mqlover,
Even iam facing the same issue can you help me in this case how did you reolve this.......
have to map some arabic characters getting from backend to my OutputRoot.
I have written two statements in my ESQL.
SET OutputRoot.Properties.CodedCharSetId='1208';
set OutputRoot.Properties.ContentType='UTF-8';
After this I am hardcoding some Arabic name as follows :
SET OutputRoot.XMLNSC.ArabicName = 'للإشتراك';
But I am unable to save the ESQL file because of the reason
"Some characters cannot be mapped using "Cp1252" cahracter encoding". |
|
Back to top |
|
 |
fjb_saper |
Posted: Sun Mar 03, 2013 12:47 am Post subject: |
|
|
 Grand High Poobah
Joined: 18 Nov 2003 Posts: 20756 Location: LI,NY
|
Did you read at all the previous posts?
Like mqjeff said the CodedCharSetValue is an Integer and not a String.
So set it to an Integer already! or could it be that you do not understand the difference here?  _________________ MQ & Broker admin |
|
Back to top |
|
 |
rekarm01 |
Posted: Sun Mar 03, 2013 4:22 am Post subject: |
|
|
Grand Master
Joined: 25 Jun 2008 Posts: 1415
|
It's a bit odd that balu2608 has the exact same problem that mqlover had over two years ago, right down to the same misspelled "cahracter encoding" error.
balu2608 wrote: |
Can any one explain me ...........................................ASAP |
First please explain where all of the previously posted help above is insufficient. The longer it takes to provide a complete and accurate problem description, the longer it takes to resolve. And if a volunteer-supported forum does not provide a suitably adequate response time, then it might be better to open a PMR.
balu2608 wrote: |
Code: |
SET OutputRoot.Properties.CodedCharSetId='1208'; |
|
As both mqjeff and fjb_saper have pointed out, this needs to be an INTEGER, not a CHARACTER.
balu2608 wrote: |
After this I am hardcoding some Arabic name as follows :
Code: |
SET OutputRoot.XMLNSC.ArabicName = 'للإشتراك'; |
|
Check that the "Text file encoding" in the toolkit editor preferences supports Arabic characters. And make sure that the OutputRoot.XMLNSC tree structure represents a well-formed XML message. The top-level element is typically a Folder element.
Even if the output message is correctly formed, some testing tools may not display the characters correctly when browsing the output queue, but may offer the option to display the bytes in hex, or to save the message off to a file to view with an external editor. |
|
Back to top |
|
 |
|