b = Character.toString(index).getBytes("Cp1140")[0];
b = characterToString(index).getBytes("Cp1140")[0];
   public byte uni2ebcdic (char index) {      if (convert) {        if (codePage.equals("1141")) {            byte b = 0x0;            try {               b = Character.toString(index).getBytes("Cp1141")[0];            } catch (java.io.UnsupportedEncodingException uee) {               uee.printStackTrace();            }            return b;         }         if (codePage.equals("1140")) {            byte b = 0x0;            try {               b = Character.toString(index).getBytes("Cp1140")[0];            } catch (java.io.UnsupportedEncodingException uee) {               uee.printStackTrace();            }            return b;         }         int ind = index;         int len = unicode.length;         if (index > '\u007F')            for (int x = 0x80; x < len; x++) {               if (unicode[x] == index) {//                  System.out.println("conversion found " + (char)index + " " + unicode[x]);                  ind = x;                  break;               }            }//         System.out.println("using conversion");         return (byte)ascii[ind & 0xff];       }      else         return (byte)ascii[index & 0xff];   }