Home | Contact Us | FAQ | Search & Site Map | Link to Us
Sign In | Join | Other 45 Sites in Network
HomeAnnouncementsWhite Papers
Discussion GroupsFirst AidDatabasesJavaBeansGUIJava 3DVirtual MachineCORBASecurityToolsGeneral
Java DirectoryOpen Source ProjectsSample Book ChaptersUser GroupsWeb Resources
Related Topics
Databases.NETMore Topics ...

Java Forum / General / August 2005

Tip: Looking for answers? Try searching our database.

ASCII TO EBCDIC: how ?

Thread view: 
mike hengins - 29 Aug 2005 22:46 GMT
Hi,
I want to write the highest value of the EBCDIC data (xFF)
into an ASCII file in Java.

In other words,
I only to need to produce one value, and this value corresponds to the
highest value in EBCDIC.

Thanks for your help.
Roedy Green - 30 Aug 2005 03:26 GMT
> Hi,
>I want to write the highest value of the EBCDIC data (xFF)
[quoted text clipped - 5 lines]
>
>Thanks for your help.

If you mean that you are literally writing 7-bit ASCII, with 8-bit
chars, and you want this marker char, you want to set your file's
encoding to: "8859_1" see http://mindprod.com/jgloss/encoding.html
see http://mindprod.com/applets/fileio.html for sample code to write
to the file.

Now write char x = 0xff;

or char x = '\u00ff';

to the file.

If you want to generate true EBCDIC files, the EBCDIC encoding is not
directly supported, though four EBCDIC variants are under
a variety of names: Cp500, Cp1046, Cp1047, Cp1148.

Then I would do an experiment to see which unicode chars map to your
desired 0xff.  Compose your file in Unicode, and trust the encoding
mechanism to create the equivalent EBCDIC.

Signature

Canadian Mind Products, Roedy Green.
http://mindprod.com Again taking new Java programming contracts.



Free Magazines

Get these publications absolutely FREE for up to 12 months. There are no hidden fees and no obligation. Simply choose a title, complete the application form and submit it. Read more ...

Oracle MagazineNetwork ComputingComputer WorldBio-IT WorldeWeekInformation WeekInfosecurity
 
Sign In
Join
My Latest Posts
My Monitored Threads
My Blog
My Photo Gallery
My Profile
My Homepage

Start New Thread
Enable EMail Alerts
Rate this Thread



©2008 Advenet LLC   Privacy Policy - Terms of Use
This website includes both content owned or controlled by Advenet as well as content owned or controlled by third parties.