HPE GreenLake Administration
- Community Home
- >
- Servers and Operating Systems
- >
- Operating Systems
- >
- Operating System - HP-UX
- >
- EBCDIC to ASCII 'C' functions?
Operating System - HP-UX
1829103
Members
2343
Online
109986
Solutions
Forums
Categories
Company
Local Language
back
Forums
Discussions
Forums
- Data Protection and Retention
- Entry Storage Systems
- Legacy
- Midrange and Enterprise Storage
- Storage Networking
- HPE Nimble Storage
Discussions
Forums
Discussions
Discussions
Discussions
Forums
Discussions
back
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
- BladeSystem Infrastructure and Application Solutions
- Appliance Servers
- Alpha Servers
- BackOffice Products
- Internet Products
- HPE 9000 and HPE e3000 Servers
- Networking
- Netservers
- Secure OS Software for Linux
- Server Management (Insight Manager 7)
- Windows Server 2003
- Operating System - Tru64 Unix
- ProLiant Deployment and Provisioning
- Linux-Based Community / Regional
- Microsoft System Center Integration
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Blogs
Information
Community
Resources
Community Language
Language
Forums
Blogs
Go to solution
Topic Options
- Subscribe to RSS Feed
- Mark Topic as New
- Mark Topic as Read
- Float this Topic for Current User
- Bookmark
- Subscribe
- Printer Friendly Page
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
06-19-2002 03:02 PM
06-19-2002 03:02 PM
Hi Experts,
Does anyone have a EBCDIC to ASCII conversion routine? My original versions were written in Pascal but I'd prefer not to recode them in C. The data files I have are a mixture of text and binary data. Please don't suggest that I use dd. I've already given up on that.
Thanks for any help or hints, Greg
Does anyone have a EBCDIC to ASCII conversion routine? My original versions were written in Pascal but I'd prefer not to recode them in C. The data files I have are a mixture of text and binary data. Please don't suggest that I use dd. I've already given up on that.
Thanks for any help or hints, Greg
I know how to do it in pascal.
Solved! Go to Solution.
3 REPLIES 3
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
06-19-2002 03:08 PM
06-19-2002 03:08 PM
Solution
Hi Greg:
I just happen to have a routine like that in my pocket. This is actually two functions: ascii_2_ebcdic and ebcdic_2_ascii. Each of these take one unsigned char char as the argument as return the converted equivalent.
That should fix you.
Attached is ebcdic.c.
Regards, Clay
I just happen to have a routine like that in my pocket. This is actually two functions: ascii_2_ebcdic and ebcdic_2_ascii. Each of these take one unsigned char char as the argument as return the converted equivalent.
That should fix you.
Attached is ebcdic.c.
Regards, Clay
If it ain't broke, I can fix that.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
06-20-2002 06:17 AM
06-20-2002 06:17 AM
Re: EBCDIC to ASCII 'C' functions?
Thank you, Cla.y.
I have a question about these functions. You have two sets of conversion tables. What's that for?
Thanks, Greg
I have a question about these functions. You have two sets of conversion tables. What's that for?
Thanks, Greg
I know how to do it in pascal.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
06-20-2002 06:35 AM
06-20-2002 06:35 AM
Re: EBCDIC to ASCII 'C' functions?
If you man dd, you will see a conv=ebcdic and conv=ibm. These are slightly different character mapping. Because the vast majority of conversions I've had to do were from IBM's, I use the _IBM define. If you comment out the #define _IBM, you will get the conv=ebcdic table.
Many years ago, I actually created an ASCII file from ' ' to '~' and then converted to EBCDIC by running the file through dd. I then took that output and fed it to od and sed to generate the conversion tables that you see. I did one for conv=ibm and another for conv=ebcdic.
Many years ago, I actually created an ASCII file from ' ' to '~' and then converted to EBCDIC by running the file through dd. I then took that output and fed it to od and sed to generate the conversion tables that you see. I did one for conv=ibm and another for conv=ebcdic.
If it ain't broke, I can fix that.
The opinions expressed above are the personal opinions of the authors, not of Hewlett Packard Enterprise. By using this site, you accept the Terms of Use and Rules of Participation.
Company
Events and news
Customer resources
© Copyright 2025 Hewlett Packard Enterprise Development LP