[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: [PATCH] IBM z/OS + EBCDIC support
From: |
Paul Eggert |
Subject: |
Re: [PATCH] IBM z/OS + EBCDIC support |
Date: |
Tue, 22 Sep 2015 15:03:16 -0700 |
User-agent: |
Mozilla/5.0 (X11; Linux x86_64; rv:38.0) Gecko/20100101 Thunderbird/38.1.0 |
Thanks for explaining. I still see a problem with the proposed patch,
though, in that (if I'm understanding it correctly) it would cause
c_isalpha (120) to succeed, even though EBCDIC 120 corresponds to U+00CC
LATIN CAPITAL LETTER I WITH GRAVE, and that is not supposed to be an
alphabetic character in the stripped-down C locale. Code that uses
c-ctype wants only ASCII letters, and departing from this would likely
break things.
Worse, the C expression "c_ispunct ('[')" might return false, as the
library may be in a locale that's incompatible with the mode the
compiler was in when it compiled the '['.
Looking at the web page you mentioned, it appears that one approach is
to assume EBCDIC 1047 (this seems to be the default and typical setting
for C programs) at both compile-time and run-time. We can check the
compile-time assumption without any code overhead. The proposed patch
does that. If someone ally wants to use a different code page, either
at compile-time or at run-time, more code will need to be written (most
likely by the poor soul who actually needs that feature).
Yes, all control characters appear to be in [\x00-\x3F], but not
everything in that range is a control character. (I remember 0x04 was
not.) I tried making c_iscntrl() a simple range check at first, but
that did not agree with the system iscntrl().
Thanks, this should be fixed in the attached patch, which I've installed.
0001-c-ctype-assume-EBCDIC-1047-for-c_iscntrl.patch
Description: Text Data
Re: [PATCH] IBM z/OS + EBCDIC support, Paul Eggert, 2015/09/22
- Re: [PATCH] IBM z/OS + EBCDIC support, Paul Eggert, 2015/09/22
- Re: [PATCH] IBM z/OS + EBCDIC support, Daniel Richard G., 2015/09/22
- Re: [PATCH] IBM z/OS + EBCDIC support,
Paul Eggert <=
- Re: [PATCH] IBM z/OS + EBCDIC support, Daniel Richard G., 2015/09/22
- Re: [PATCH] IBM z/OS + EBCDIC support, Paul Eggert, 2015/09/22
- Re: [PATCH] IBM z/OS + EBCDIC support, Daniel Richard G., 2015/09/23
- Re: [PATCH] IBM z/OS + EBCDIC support, Paul Eggert, 2015/09/23
- Re: [PATCH] IBM z/OS + EBCDIC support, Paul Eggert, 2015/09/23
- Re: [PATCH] IBM z/OS + EBCDIC support, Daniel Richard G., 2015/09/23
- Re: [PATCH] IBM z/OS + EBCDIC support, Paul Eggert, 2015/09/25
- Re: [PATCH] IBM z/OS + EBCDIC support, Daniel Richard G., 2015/09/25
- Re: [PATCH] IBM z/OS + EBCDIC support, Paul Eggert, 2015/09/25
- Re: [PATCH] IBM z/OS + EBCDIC support, Daniel Richard G., 2015/09/26