Win a copy of Functional Reactive Programming this week in the Other Languages forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

EBCDIC Conversion in groovy

 
Nishiru San
Greenhorn
Posts: 3
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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
Posts: 3
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Instead of f.write used f.setBytes to solve the issue
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic