|
RSS Feed - WebSphere MQ Support
|
RSS Feed - Message Broker Support
|
 |
|
Converting EBCDIC to ASCII |
« View previous topic :: View next topic » |
Author |
Message
|
Washington Morais |
Posted: Mon Apr 30, 2012 6:00 am Post subject: Converting EBCDIC to ASCII |
|
|
Newbie
Joined: 09 Feb 2012 Posts: 7
|
hi all...
I need to get an EBCDIC message and convert it to ASCII. Is this enough?
Code: |
...
if (getEbcdic)
{
mQMessage.CharacterSet = [ what is the correct code? ];
mQGetMessageOptions.Options |= MQC.MQGMO_CONVERT;
}
...
|
Message info:
Format: MQSTR
CCSID: 500
Encoding: 785
tks... |
|
Back to top |
|
 |
mqjeff |
Posted: Mon Apr 30, 2012 6:47 am Post subject: |
|
|
Grand Master
Joined: 25 Jun 2008 Posts: 17447
|
We don't know if it's sufficient or not.
We don't know the depth and complexity of your requirements.
If you actually tested that code, you would have a better idea of the results you would get.
Then you could investigate whether or not those results were sufficient.
You haven't said whether you are using Java or .NET. Assuming you're using Java, you would set your CharacterSet on the message object to the destination of the conversion, i.e. the character set you wanted the data to BECOME.
But only if you are doing this *before* you do the get.
You also probably do not need to actually set the character set. It will likely default to a useful value based on the environment your code is running under. |
|
Back to top |
|
 |
rekarm01 |
Posted: Tue May 01, 2012 1:32 pm Post subject: Re: Converting EBCDIC to ASCII |
|
|
Grand Master
Joined: 25 Jun 2008 Posts: 1415
|
mqjeff wrote: |
You haven't said whether you are using Java or .NET. |
The code looks like .NET; the method/property names start with an upper-case character, and the .NET MQC interface isn't deprecated. However, the application logic for converting messages is much the same either way.
mqjeff wrote: |
You also probably do not need to actually set the character set. It will likely default to a useful value ... |
While this is true for most platforms, .NET seems to default to ccsid=1200 (UTF-16), rather than the qmgr ccsid, which may not be useful in this case.
Washington Morais wrote: |
Message info:
Format: MQSTR
CCSID: 500
Encoding: 785 |
This presumably describes the input message.
Washington Morais wrote: |
Code: |
mQMessage.CharacterSet = [ what is the correct code? ];
mQGetMessageOptions.Options |= MQC.MQGMO_CONVERT; |
|
The correct code depends on how the receiving application expects to interpret any non-ASCII characters. There are many ASCII-based coded character sets, such as:- 367 - US ANSI X3.4 ASCII (7-bit)
- 819 - ISO/IEC 8859-1 (8-bit)
- 1208 - UTF-8 (8-bit, multi-byte)
If .NET converts during read, rather than WMQ converting during get, it's not necessary to set the MQGMO_CONVERT option.
Washington Morais wrote: |
Is this enough? |
The best way to find that out is to test it. |
|
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
|
|
|
|