public byte[] stringToEbcdic(String s, String encoding){
String payload = null;
try {
payload = new String(s.getBytes("encoding"), "ISO-8859-1");
} catch (UnsupportedEncodingException e) {
e.printStackTrace();
}
return payload.getBytes();
}
我应该能够像这样调用方法
byte[] b = stringToEbcdic("abcd", "IBM01140");
但它不工作。