Author |
Message
|
willhuang_78 |
Posted: Mon Dec 20, 2004 5:22 pm Post subject: Question of EBCDIC to ASCII conversion |
|
|
Newbie
Joined: 20 Dec 2004 Posts: 9
|
Hi:
I currently have a working application that receives messages from a mainframe(os/390) through MQ to a java app. The java app is ASCII, but the mainframe is EBCDIC. At the moment I translate the message in my java app from EBCDIE to ASCII. I receive messages using JMS but in which there are some chinese words, they shows "??...", how do I identify them from the type of String? How do I config MQ's CCSID?
Thanks in advance.
Will _________________ hi~ |
|
Back to top |
|
 |
fjb_saper |
Posted: Mon Dec 20, 2004 7:42 pm Post subject: |
|
|
 Grand High Poobah
Joined: 18 Nov 2003 Posts: 20756 Location: LI,NY
|
You should not have to translate from EBCDIC
Make sure that the message format is MQSTR
Make sure that the open option is with Convert (mq java).
JMS should be setting this option for you automatically
Finally check that there is a translation option from one CCSID to the other.
(Read intercomm manual about CCSID translation tables)
Enjoy  |
|
Back to top |
|
 |
willhuang_78 |
Posted: Tue Dec 21, 2004 3:17 am Post subject: |
|
|
Newbie
Joined: 20 Dec 2004 Posts: 9
|
Where can config MQSTR ? _________________ hi~ |
|
Back to top |
|
 |
willhuang_78 |
Posted: Tue Dec 21, 2004 3:21 am Post subject: |
|
|
Newbie
Joined: 20 Dec 2004 Posts: 9
|
But in the String,there some chinese word, they can not be showed, how can I show them? _________________ hi~ |
|
Back to top |
|
 |
Nigelg |
Posted: Tue Dec 21, 2004 5:32 am Post subject: |
|
|
Grand Master
Joined: 02 Aug 2004 Posts: 1046
|
You cannot.
As you describe it, the MD Format and CodedCharSetId fields do not actually describe the format and CCSID of the msg. The msg consists of some data in the mainframe CCSID (500, 37?) and also some data in Chinese (unknown CCSID). The data is converted from 500 -> 819 as if all the data is in 500, so the Chinese DBCS characters are converted as if they were SBCS chars in 500, so they are garbled.
If you want to embed Chinese characters in a msg, you must define a user data format, and supply a user-defined convesion routine. The method for doing this is described in the APG, Writing data-conversion exits. |
|
Back to top |
|
 |
fjb_saper |
Posted: Tue Dec 21, 2004 12:03 pm Post subject: |
|
|
 Grand High Poobah
Joined: 18 Nov 2003 Posts: 20756 Location: LI,NY
|
Remember automatic character code translation CCSID is just a translation of the machine representation of the same information.
It does not translate any language. It assumes that the message does not contain any binary data that needs to be conserved from one CCSID to the other.
Now if you represent the chinese part of your message in a different characterset than the rest of your message you need to either split the message with different CCSIDs on each part or use writeUTF and readUTF methods.... and read up a lot on the way MQ handles those.
Enjoy  |
|
Back to top |
|
 |
willhuang_78 |
Posted: Thu Dec 23, 2004 8:54 pm Post subject: problem has been resolved! |
|
|
Newbie
Joined: 20 Dec 2004 Posts: 9
|
Accepting your advances, I have rsolved the intractable problem to me!
thanks a lot! _________________ hi~ |
|
Back to top |
|
 |
|