File APIs for Java Developers
Manipulate DOC, XLS, PPT, PDF and many others from your application.
http://aspose.com/file-tools
The moose likes Java in General and the fly likes String.getBytes( Big Moose Saloon
  Search | Java FAQ | Recent Topics
Register / Login


Win a copy of The Mikado Method this week in the Agile and other Processes forum!
JavaRanch » Java Forums » Java » Java in General
Reply Bookmark "String.getBytes("Cp1047") get wrong values for 25 and 15 for packed decimal value." Watch "String.getBytes("Cp1047") get wrong values for 25 and 15 for packed decimal value." New topic
Author

String.getBytes("Cp1047") get wrong values for 25 and 15 for packed decimal value.

Siva Vu
Greenhorn

Joined: Sep 01, 2004
Posts: 22
Retrieving string from DB2 (Z/OS) (JDBC)
that does contain packed decimal value.

When I am trying to get bytes using String.getBytes("Cp1047"),
I am getting correct bytes for all
Excpet for 15 and 25.
Rather it is resulting in swapped values for these,
i.e, it is getting 25 for 15 and vice versa.

What could be the wrong?
Or should I read bytes directly from ResultSet
using ResultSet.getBinaryStream("COLUMN") ?

Or do 15 and 25 have some special meaning on the
Java Platform.
Thanks in advance.


Siva
 
I agree. Here's the link: http://ej-technologies/jprofiler - if it wasn't for jprofiler, we would need to run our stuff on 16 servers instead of 3.
 
subject: String.getBytes("Cp1047") get wrong values for 25 and 15 for packed decimal value.
 
Similar Threads
Cp1047 Charecter Encoding to read JDBC string EBCDIC data.
Convert from ASCII to EBCDIC
insertion of Packed decimal data into Db2 table from Java
Two characters read from file come in the same with BufferedReader
Packed decimal conversion - Java