Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Erroneous EBCDIC tables in zipl/boot/ebcdic_conv.c #125

Open
huth opened this issue Nov 18, 2021 · 2 comments
Open

Erroneous EBCDIC tables in zipl/boot/ebcdic_conv.c #125

huth opened this issue Nov 18, 2021 · 2 comments

Comments

@huth
Copy link
Contributor

huth commented Nov 18, 2021

zipl/boot/ebcdic_conv.c contains two tables for converting EBCDIC to ASCII, ebcdic_037 and ebcdic_500. However, if you compare the two tables line by line, you can see that they are exactly the same! So this is either a waste of precious bytes, or one of the tables is just wrong.
Comparing the tables with the ones in the Linux kernel (arch/s390/kernel/ebcdic.c), it seems to me like ebcdic_500 is wrong and needs fixing?

@mario-held
Copy link
Contributor

When Wikipedia is correct, the tables should not be exactly the same. In https://en.wikipedia.org/wiki/Code_page_37 is stated:
Code page 500, known as "International EBCDIC",[5] "International Latin-1" or "International Number 5",[10] is the other major EBCDIC encoding for the ISO/IEC 8859-1 repertoire. It is used in Belgium, Switzerland and on AS/400 systems in Canada.[5] It is related to code page 37 and has the same repertoire, but differs in seven positions; in particular, it encodes [ and ] at 4Ahex and 5Ahex respectively, which are used for the cent sign (¢) and exclamation point (!) in code page 37. The caret (^) is also encoded at 5Fhex, similarly to code page 37-2 and 1047. The ¢ is encoded at B0hex, the ¬ at BAhex, the ! at 4Fhex and the pipe character (|) at BBhex.[14][15] Code page 500 is in turn related to the German code page 273, which swaps several character pairs in a manner corresponding to the differences between DRV8 and ISO/IEC 8859-1, resulting in placement of the hard brackets at 63hex and FChex.[16]
I couldn't find more recent documentation inside IBM than that: https://www.ibm.com/docs/en/SSEQ5Y_13.0.0/com.ibm.pcomm.doc/reference/pdf/hcp_referenceV58.pdf which has code pages 037 and 500 included.

@huth
Copy link
Contributor Author

huth commented Jan 3, 2022

Yes, there should definitely be a difference in the tables, you can see it in the Linux kernel sources, too (arch/s390/kernel/ebcdic.c).

See my comment here for a suggestion how to fix it:

#126 (comment)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants