aspose file tools*
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 Spring in Action this week in the Spring 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
 
 
subject: String.getBytes("Cp1047") get wrong values for 25 and 15 for packed decimal value.