my dog learned polymorphism*
The moose likes Java in General and the fly likes String.getBytes( Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login


Win a copy of EJB 3 in Action this week in the EJB and other Java EE Technologies forum!
JavaRanch » Java Forums » Java » Java in General
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://aspose.com/file-tools
 
subject: String.getBytes("Cp1047") get wrong values for 25 and 15 for packed decimal value.
 
Similar Threads
insertion of Packed decimal data into Db2 table from Java
Two characters read from file come in the same with BufferedReader
Cp1047 Charecter Encoding to read JDBC string EBCDIC data.
Packed decimal conversion - Java
Convert from ASCII to EBCDIC