It's not a secret anymore!*
The moose likes Groovy and the fly likes EBCDIC Conversion in groovy Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login


Win a copy of The Java EE 7 Tutorial Volume 1 or Volume 2 this week in the Java EE forum
or jQuery UI in Action in the JavaScript forum!
JavaRanch » Java Forums » Languages » Groovy
Bookmark "EBCDIC Conversion in groovy" Watch "EBCDIC Conversion in groovy" New topic
Author

EBCDIC Conversion in groovy

Nishiru San
Greenhorn

Joined: Feb 07, 2013
Posts: 3
I was trying for ASCII to EBCDIC conversion in groovy

I was trying to write hex value 81 and 82 ( which are EBCDIC hex values for a and b) to a file.

Please find the code below




But the code writes hex value 3F and 82 to the file. It seems that when i give byte(0x81) it is not resolving and putting 3F which means character '?' in ASCII. All other hex values are fine.

I have tried this in Windows 7 32 bit machine. Tried the same code in Oracle Enterprise 5 Linux 64 bit machine. Surprisingly the same code wrote 'EFBF EFBF' in the file .

Can someone advice on this.
Nishiru San
Greenhorn

Joined: Feb 07, 2013
Posts: 3
Instead of f.write used f.setBytes to solve the issue
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: EBCDIC Conversion in groovy