Win a copy of Cross-Platform Desktop Applications: Using Node, Electron, and NW.js this week in the JavaScript forum!
  • Post Reply Bookmark Topic Watch Topic
  • New Topic

file encoded with EBCDIC  RSS feed

 
Preetha Arunkumar
Greenhorn
Posts: 3
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi Ranchers,

I have a source file which is encoded in "EBCDIC-j" ,the interface code is designed in a way that it has to retrieve the file from the local folder and then those data will be processed and get inserted into the given database.

The program code could insert the data into the target database but when I checked for the type of data in database I found that it has been stored as unknown format (like the same as encoded value ).

when I FTP the file I have used the ASCII as the transfer mode.

could anyone suggest me on how to get the vaues in decoded format?

Thanks in advance,
Preethi
 
James Sabre
Ranch Hand
Posts: 781
Java Netbeans IDE Ubuntu
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
The file is not ASCII so transfer the file in binary mode. Then create an InputStreamReader with first parameter a FileInputStream opened using your EBCDIC file and the second parameter specifying the encoding. There are many EBCDIC variants so you need to choose one from http://download.oracle.com/javase/1.4.2/docs/guide/intl/encoding.doc.html . I have not used these for a long time but I seem to remember that I needed Cp285 but I am based in the UK so that was natural.

 
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!