scenario:
I'm communicating with CICS mainframe through Messaging Queue(MQ), I receive msg in EBCDIC codepage and I'm trying to convert it to Cp1256,
this message have arabic characters and numbers,
here what i do for converting the EBCDIC message bytes
String var = *new* String(myMessage.readLine().getBytes(),"Cp420");
but when I print this message i found many characters that is not in the original message before the conversion, such as C, B , �
so i looked like its garbage data but its not
so i did the following to remove this characters
StringBuffer tmp = *new* StringBuffer();
*int x = var.length();*
var = var.replace('C', '-');
var = var.replace('�', '-');
var = var.replace('B', '-');
var = var.replace('', '-');
*for*(*int* i=1;i<=var.length();i++){
*if*(var.charAt(x-i) == '-'){
*continue*;
}*else*
tmp.append(var.charAt(x-i));
}
but still have missing and wrong characters, as i use this message to export it as a web service response message,
any idea for successful conversion from EBCDIC to Cp1256 and back from Cp1256 to EBCDIC ??