Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations strongm on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

EBCDIC to Ascii using Codepage 1140

Status
Not open for further replies.

rccb

Technical User
Oct 27, 2011
4
GB
Hi,

I need to code an access database that decodes a EBCDIC codepage 1140 to Ascii.

I have used a number of codepages but approx 50% of the chars don't decode.

This one is the closest. (Taken from the MS website)
' 00 01 02 03 37 2D 2E 2F 16 05 25 0B 0C 0D 0E 0F
' 10 11 12 13 3C 3D 32 26 18 19 3F 27 1C 1D 1E 1F
' 40 5A 7F 7B 5B 6C 50 7D 4D 5D 5C 4E 6B 60 4B 61
' F0 F1 F2 F3 F4 F5 F6 F7 F8 F9 7A 5E 4C 7E 6E 6F
' 7C C1 C2 C3 C4 C5 C6 C7 C8 C9 D1 D2 D3 D4 D5 D6
' D7 D8 D9 E2 E3 E4 E5 E6 E7 E8 E9 AD E0 BD 5F 6D
' 79 81 82 83 84 85 86 87 88 89 91 92 93 94 95 96
' 97 98 99 A2 A3 A4 A5 A6 A7 A8 A9 C0 4F D0 A1 07
' 20 21 22 23 24 15 06 17 28 29 2A 2B 2C 09 0A 1B
' 30 31 1A 33 34 35 36 08 38 39 3A 3B 04 14 3E E1
' 41 42 43 44 45 46 47 48 49 51 52 53 54 55 56 57
' 58 59 62 63 64 65 66 67 68 69 70 71 72 73 74 75
' 76 77 78 80 8A 8B 8C 8D 8E 8F 90 9A 9B 9C 9D 9E
' 9F A0 AA AB AC 4A AE AF B0 B1 B2 B3 B4 B5 B6 B7
' B8 B9 BA BB BC 6A BE BF CA CB CC CD CE CF DA dB
' DC DD DE DF EA EB EC ED EE EF FA FB FC FD FE FF

Does anyone have any ideas how to decode my file?>
 
Hi,

I have used the code from microsoft and it only partially converts the string. I would say about 50% of the string is control chars.

Many thanks.
 
That implies either the codepage isn't as described or your source file has lots of control codes!
Can you paste an example of your source and ideally what it's supposed to display as?

B.

----------------------------------------------
Ben O'Hara
David W. Fenton said:
We could be confused in exactly the same way, but confusion might be like Nulls, and not comparable.
 
Hi Rob,

You can upload the files to MediaFire and attach the url.

Cheers

B.

----------------------------------------------
Ben O'Hara
David W. Fenton said:
We could be confused in exactly the same way, but confusion might be like Nulls, and not comparable.
 
Hi Mediashare is a blocked site at work. I can do this later tonight when I get home.
 
The Microsoft method is rather bloated when there is an API that can do the same job more cleanly in about 3 lines of code

See my example in thread222-1288126 (although you may want to set CP_EBCDIC to 37 rather than the 875 that I used). You'll find a list of code pages here:
 
Sorry - must read original post more carefully. You'll just need to set CP_EBCDIC to 1140
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top