title: What codepage/charset should be used to interpret data coming from an MVS system into a Java Environment?
body: <p>I've come into an interesting problem (as is often the case in interacting with legacy systems).  I'm working on an application (which currently runs on a x86 Linux or Windows system) that can receive requests from a variety of systems, one of them being an MVS system.  </p>
  
  <p>I am attempting to determine which codepage/charset I should be using to interpret request data coming from the MVS system.  </p>
  
  <p>In the past, I've used 'cp500' (IBM-500) to interpret byte date coming for z/OS systems, however I fear that since MVS is a bit of a legacy system, and that since IBM seemed to change it's mind consistently with respect to what encoding to use (there must be tens of EBCDIC encodings), that cp500 may not be the correct encoding.  </p>
  
  <p>The best resource I've found on character sets in Java is: <a href="http://mindprod.com/jgloss/encoding" rel="nofollow noreferrer">http://mindprod.com/jgloss/encoding</a> .  However from this site, and IBM Infocenters, I have not been able to get a clear answer.</p>
  
  <p>EDIT: Added from my response to Pax below:</p>
  
  <p>There was a glaring hole in my question in the origin of the request data. In this case, the origin of the data is through a Websphere MQ interface. Websphere MQ does have facilities for translating to the proper encoding, however that is only for reading the data using MQMessage.readString(), which has since been deprecated. I would prefer to use this, however I am using a proprietary interface framework in which I can't change how the message is read off the MQQueue, which is reading bytes directly off the Queue and thus I am left handle translation.</p>
  
  <p>Final Answer:  I wanted to follow up on this.  It turns out the correct Character Set was indeed cp500 (IBM-500).  However, i'm under the impression that results may vary.  Some tips for anyone else with the same issue:</p>
  
  <p>Utilize Charset.availableCharsets();.  This will give you a map of Supported Character Sets in your run time.  I iterated through these sets and printed out my byte data translated into that character set.  While it didn't give me the answer I wanted (mainly because I wasn't able to read data as it was coming in), I imagine it could be helpful for others.</p>
  
  <p>Refer to: <a href="http://mindprod.com/jgloss/encoding" rel="nofollow noreferrer">http://mindprod.com/jgloss/encoding</a> for a list of supported char sets.</p>
  
  <p>Lastly, though I have not confirmed this, but ensure you are using the right JRE.  I'm thinking that the IBM Runtimes support more EBCDIC character sets then OpenJDK or Sun's Runtimes.</p>