On Tue, 2017 Apr 25 10:59+0000, Thorsten Glaser wrote: > Well, the hand-edited tables would be known to be stable and > (somewhat) correct, but… > > >Even if you really do need a table, you could populate it on startup > >using these. > > I guess I can probably work with that. > > So we’re up for testing again! > [...]
I had to get rid of <err.h>, and replace err() with printf(). But otherwise, here is the result: 00 01 02 03 9C 09 86 7F 97 8D 8E 0B 0C 0D 0E 0F 10 11 12 13 9D 0A 08 87 18 19 92 8F 1C 1D 1E 1F 80 81 82 83 84 85 17 1B 88 89 8A 8B 8C 05 06 07 90 91 16 93 94 95 96 04 98 99 9A 9B 14 15 9E 1A 20 A0 E2 E4 E0 E1 E3 E5 E7 F1 A2 2E 3C 28 2B 7C 26 E9 EA EB E8 ED EE EF EC DF 21 24 2A 29 3B 5E 2D 2F C2 C4 C0 C1 C3 C5 C7 D1 A6 2C 25 5F 3E 3F F8 C9 CA CB C8 CD CE CF CC 60 3A 23 40 27 3D 22 D8 61 62 63 64 65 66 67 68 69 AB BB F0 FD FE B1 B0 6A 6B 6C 6D 6E 6F 70 71 72 AA BA E6 B8 C6 A4 B5 7E 73 74 75 76 77 78 79 7A A1 BF D0 5B DE AE AC A3 A5 B7 A9 A7 B6 BC BD BE DD A8 AF 5D B4 D7 7B 41 42 43 44 45 46 47 48 49 AD F4 F6 F2 F3 F5 7D 4A 4B 4C 4D 4E 4F 50 51 52 B9 FB FC F9 FA FF 5C F7 53 54 55 56 57 58 59 5A B2 D4 D6 D2 D3 D5 30 31 32 33 34 35 36 37 38 39 B3 DB DC D9 DA 9F > Can you run this in both codepages, and possibly their Euro > equivalents? I'm afraid I'm not able to switch the codepage. Some searching indicates that this can be done in a shell with e.g. LANG=En_us.IBM-037 LC_ALL=En_us.IBM-037 but that doesn't affect the output of your program. It's possible that this needs to be set outside the z/OS Unix environment, in the actual mainframe UI, and that eludes even me :> You don't have enough confidence in etoa_l() to generate the table at build time? > There’s no EBCDIC to Unicode function (ideal would be something that > gets a char and returns an int or something, not on buffers) though, > is there? (If there is, runs of that would also be welcome.) I don’t > find one in the IBM library reference, and I had a look at z/OS > Unicode Services but… there’s CUNLCNV, but it looks extremely… IBM. So > maybe we can or have to make do with etoa and its limitations… > probably still enough at this point. Don't forget that ISO 8859-1 is equivalent to the first 256 codepoints of Unicode ;) --Daniel -- Daniel Richard G. || sk...@iskunk.org My ASCII-art .sig got a bad case of Times New Roman.