on 02-28-2006 8:22 AM
Hi everyone,
I want to translate from code page UTF-8 to code page 1255.
Is there a way to do it in Java ?
I didn't find any class that could do it like in .Net using System.text package.
Thanks in advance.
Hi David,
Try this code.. Of course change your code page accordingly..
public static void main (String args []) throws Exception {
try {
String str="ABC";
str = new String(str.getBytes("8859_1"),"cp037");
System.out.println("In EBCDIC :"+str);
str = new String(str.getBytes("cp037"),"8859_1");
System.out.println("In ASCII :"+str);
}
catch(Exception e){
e.printStackTrace();
}
}
Regards,
Ananth
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
User | Count |
---|---|
93 | |
10 | |
10 | |
9 | |
9 | |
7 | |
6 | |
5 | |
5 | |
4 |
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.