From d1a72437ecac49c56d18c05b33cd734a29cc3c29 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Henrik=20Grubbstr=C3=B6m=20=28Grubba=29?= <grubba@grubba.org> Date: Mon, 22 Feb 1999 23:36:58 +0100 Subject: [PATCH] Added some notes on EBCDIC conversion. Rev: src/cpp.c:1.38 --- src/cpp.c | 25 ++++++++++++++++++++++--- 1 file changed, 22 insertions(+), 3 deletions(-) diff --git a/src/cpp.c b/src/cpp.c index 5718c210d7..9c701111fa 100644 --- a/src/cpp.c +++ b/src/cpp.c @@ -5,7 +5,7 @@ \*/ /* - * $Id: cpp.c,v 1.37 1999/02/22 21:35:28 grubba Exp $ + * $Id: cpp.c,v 1.38 1999/02/22 22:36:58 grubba Exp $ */ #include "global.h" #include "language.h" @@ -2103,8 +2103,12 @@ void f_cpp(INT32 args) if ((!sp[-args].u.string->size_shift) && (sp[-args].u.string->len > 1)) { /* Try to determine if we need to recode the string */ - /* At least a prefix of two bytes need to be 7bit in a valid - * Pike program. + /* Observations: + * + * * At least a prefix of two bytes need to be 7bit in a valid + * Pike program. + * + * * NUL isn't valid in a Pike program. */ /* Heuristic: * @@ -2117,9 +2121,24 @@ void f_cpp(INT32 args) * 0xfe | 0xff | 16bit Unicode string reverse byte order. * 0x7b | 0x83 | EBCDIC-US ("#c"). * 0x7b | 0x40 | EBCDIC-US ("# "). + * 0x7b | 0x09 | EBCDIC-US ("#\t"). * --------+---------+------------------------------------------ * Other | Other | 8bit standard string. */ + /* NOTE: + * + * * EBCDIC conversion needs to first convert the first line + * according to EBCDIC-US, and then the rest of the string + * according to the encoding specified by the first line. + * + * * It's an error for a program written in EBCDIC not to + * start with a #charset directive. + * + * Obfuscation note: + * + * * This still allows the rest of the file to be written in + * another encoding than EBCDIC. + */ } init_string_builder(&this.buf, 0); -- GitLab