473,387 Members | 1,575 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,387 software developers and data experts.

EBCDIC to ASCII

Is there an easy way to convert a string that is in EBCDIC to ASCII
Nov 16 '05 #1
8 17902

"Chris H." <sp**@someone.else> wrote in message
news:ce*******************@news.demon.co.uk...
Is there an easy way to convert a string that is in EBCDIC to ASCII

Assuming that your EBCDIC is codepage 37

System.Text.Decoder EBCDICDecoder =
System.Text.Encoding.GetEncoding(37).GetDecoder();

Decoder.GetChars will decode an EBCDIC byte array into a .NET string. From
there you can use the ASCII encoder to encode the .NET string into a byte
array as ASCII.

Other EBCDIC code pages are listed here:

http://msdn.microsoft.com/library/de...icode_81rn.asp
David
Nov 16 '05 #2
After a quick Google
search(http://www.google.com/search?hl=en&l...to+ASCII+C%23),
I found this link:

http://www.yoda.arachsys.com/csharp/ebcdic/

(Leave it to Jon Skeet to master this... lol)

Great work Jon! :-)

--
HTH

Kyril Magnos
"I'm not a developer anymore, I'm a software engineer now!" :-)

"Chris H." <sp**@someone.else> wrote in message
news:ce*******************@news.demon.co.uk...
| Is there an easy way to convert a string that is in EBCDIC to ASCII
|
|
Nov 16 '05 #3
Kyril Magnos <ky**********@yahoo.com> wrote:
After a quick Google
search(http://www.google.com/search?hl=en&l...to+ASCII+C%23),
I found this link:

http://www.yoda.arachsys.com/csharp/ebcdic/

(Leave it to Jon Skeet to master this... lol)

Great work Jon! :-)


Shame it turned out to be unnecessary, as there are standard code pages
for EBCDIC. Still, it was fun - especially given that I'll probably
never use a machine which uses EBCDIC :)

--
Jon Skeet - <sk***@pobox.com>
http://www.pobox.com/~skeet
If replying to the group, please do not mail me too
Nov 16 '05 #4
Awww, c'mon, you can't invest in one of those monster IBM mainframes
anymore? Just think how nice and warm it would keep the house if you stored
it in the basement... ;-)

--
Kyril
"Jon Skeet [C# MVP]" <sk***@pobox.com> wrote in message
news:MP************************@msnews.microsoft.c om...
| Kyril Magnos <ky**********@yahoo.com> wrote:
| > After a quick Google
| >
search(http://www.google.com/search?hl=en&l...to+ASCII+C%23),
| > I found this link:
| >
| > http://www.yoda.arachsys.com/csharp/ebcdic/
| >
| > (Leave it to Jon Skeet to master this... lol)
| >
| > Great work Jon! :-)
|
| Shame it turned out to be unnecessary, as there are standard code pages
| for EBCDIC. Still, it was fun - especially given that I'll probably
| never use a machine which uses EBCDIC :)
|
| --
| Jon Skeet - <sk***@pobox.com>
| http://www.pobox.com/~skeet
| If replying to the group, please do not mail me too
Nov 16 '05 #5
Cool....Thanks Guys
"Chris H." <sp**@someone.else> wrote in message
news:ce*******************@news.demon.co.uk...
Is there an easy way to convert a string that is in EBCDIC to ASCII

Nov 16 '05 #6

"Kyril Magnos" <ky**********@yahoo.com> wrote in message
news:eR**************@TK2MSFTNGP09.phx.gbl...
Awww, c'mon, you can't invest in one of those monster IBM mainframes
anymore? Just think how nice and warm it would keep the house if you stored it in the basement... ;-)


And how cool you'd stay in the summer if you rerouted its dedicated AC
upstairs :-)
Nov 16 '05 #7
lmao

--
HTH

Kyril Magnos
"I'm not a developer anymore, I'm a software engineer now!" :-)

"Mike Schilling" <ms*************@hotmail.com> wrote in message
news:ec**************@TK2MSFTNGP09.phx.gbl...
|
| "Kyril Magnos" <ky**********@yahoo.com> wrote in message
| news:eR**************@TK2MSFTNGP09.phx.gbl...
| > Awww, c'mon, you can't invest in one of those monster IBM mainframes
| > anymore? Just think how nice and warm it would keep the house if you
| stored
| > it in the basement... ;-)
|
| And how cool you'd stay in the summer if you rerouted its dedicated AC
| upstairs :-)
|
|
Nov 16 '05 #8
Jon Skeet [C# MVP] wrote:
Kyril Magnos <ky**********@yahoo.com> wrote:
After a quick Google
search(http://www.google.com/search?hl=en&l...C+%2Bto+ASCII+
C%23), I found this link:

http://www.yoda.arachsys.com/csharp/ebcdic/

(Leave it to Jon Skeet to master this... lol)

Great work Jon! :-)


Shame it turned out to be unnecessary, as there are standard code
pages for EBCDIC. Still, it was fun - especially given that I'll
probably never use a machine which uses EBCDIC :)


Some time ago, while doing a Win XP installation to resurrect a friend's
installation, I realized that you can actually choose which code pages are
to be installed. I don't remember if the EBCDIC CPs where on the default
list, so your code may still be useful ;-)

Cheers,

--
Joerg Jooss
jo*********@gmx.net

Nov 16 '05 #9

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

12
by: John Leslie | last post by:
I need to write a string to a file in EBCDIC. Do I need to do it character by character using a translation table, or is there a function to translate the whole string? (I am aware that I can...
2
by: Ranjan | last post by:
Hi folks! I am trying to convert EBCDIC file to ASCII file. the issues are 1) Can all EBCDIC file be converted to ASCII without loss of information.(There is one character cent sign which is not...
9
by: jeff M via .NET 247 | last post by:
I'm still having problems reading EBCDIC files. Currently itlooks like the lower range (0 to 127) is working. I have triedthe following code pages 20284, 20924, 1140, 37, 500 and 20127.By working I...
4
by: Ernie Otero | last post by:
Does anyone know where I can find a function to convert numeric data to overpunch format? I've looked around but I can't seem to find any. Ernie
5
by: Tin Gherdanarra | last post by:
This is probably a fringe programme... In the past I used a C-program to convert from EBCDIC (CP500) to ASCII/Unicode. As you might guess, this is simply a 256-byte lookup table. I lifted it...
6
by: Ven | last post by:
Hi, I am reading a kind of below mentioned raw data into my C++ program and writing it out but I want this to be converted into EBCDIC format, how can I accomplish this ? Right now I am using...
44
by: Pilcrow | last post by:
Is there a way that a proram can detect whether it is operating in an ASCII or an EBCDIC environment?
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
by: aa123db | last post by:
Variable and constants Use var or let for variables and const fror constants. Var foo ='bar'; Let foo ='bar';const baz ='bar'; Functions function $name$ ($parameters$) { } ...
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
0
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
0
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
0
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.