473,698 Members | 2,662 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

EBCDIC to ASCII

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

"Chris H." <sp**@someone.e lse> wrote in message
news:ce******** ***********@new s.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.Dec oder EBCDICDecoder =
System.Text.Enc oding.GetEncodi ng(37).GetDecod er();

Decoder.GetChar s 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.e lse> wrote in message
news:ce******** ***********@new s.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**********@y ahoo.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.co m>
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.co m> wrote in message
news:MP******** *************** *@msnews.micros oft.com...
| Kyril Magnos <ky**********@y ahoo.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.co m>
| 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.e lse> wrote in message
news:ce******** ***********@new s.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**********@y ahoo.com> wrote in message
news:eR******** ******@TK2MSFTN GP09.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******** ******@TK2MSFTN GP09.phx.gbl...
|
| "Kyril Magnos" <ky**********@y ahoo.com> wrote in message
| news:eR******** ******@TK2MSFTN GP09.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**********@y ahoo.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
4636
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 convert a whole file using Unix utilities, but this file will have only a few header records in EBCDIC)
2
1338
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 in ASCII, how to handle that?) 2)What about non printable characters in EBCDIC, do they all converted to ASCII format? Suggest some way. Thanks n Regards Ranjan
9
6758
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 get the correct answer by taking the decimal valueand using that as an index to an array that will map to thecorrect EBCDIC value in hex. By larger values, an example would be "AA" in EBCDIC hex wouldgive me the value of 63 in decimal (ASCII) when...
4
3906
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
3730
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 from Larry Wall's perl source, to be found here: http://www.nntp.perl.org/group/perl.mvs/735 This worked very well. For some reason, the C# codec for
6
2610
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 the following code ifstream Source("source_file"); ofstream Dest("dest_file");
44
3848
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
8674
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, people are often confused as to whether an ONU can Work As a Router. In this blog post, we’ll explore What is ONU, What Is Router, ONU & Router’s main usage, and What is the difference between ONU and Router. Let’s take a closer look ! Part I. Meaning of...
0
8603
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 effortlessly switch the default language on Windows 10 without reinstalling. I'll walk you through it. First, let's disable language synchronization. With a Microsoft account, language settings sync across devices. To prevent any complications,...
0
9157
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, it seems that the internal comparison operator "<=>" tries to promote arguments from unsigned to signed. This is as boiled down as I can make it. Here is my compilation command: g++-12 -std=c++20 -Wnarrowing bit_field.cpp Here is the code in...
0
8861
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each protocol has its own unique characteristics and advantages, but as a user who is planning to build a smart home system, I am a bit confused by the choice of these technologies. I'm particularly interested in Zigbee because I've heard it does some...
1
6518
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome a new presenter, Adolph Dupré who will be discussing some powerful techniques for using class modules. He will explain when you may want to use classes instead of User Defined Types (UDT). For example, to manage the data in unbound forms. Adolph will...
0
4366
by: TSSRALBI | last post by:
Hello I'm a network technician in training and I need your help. I am currently learning how to create and manage the different types of VPNs and I have a question about LAN-to-LAN VPNs. The last exercise I practiced was to create a LAN-to-LAN VPN between two Pfsense firewalls, by using IPSEC protocols. I succeeded, with both firewalls in the same network. But I'm wondering if it's possible to do the same thing, with 2 Pfsense firewalls...
0
4615
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
1
3045
by: 6302768590 | last post by:
Hai team i want code for transfer the data from one system to another through IP address by using C# our system has to for every 5mins then we have to update the data what the data is updated we have to send another system
2
2327
muto222
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.

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.