Relay-Version: version B 2.10 5/3/83; site utzoo.UUCP Path: utzoo!mnetor!uunet!husc6!cca!mirror!ima!haddock!karl From: karl@haddock.ISC.COM (Karl Heuer) Newsgroups: comp.lang.c Subject: ANSI character escapes (was: Comparing chars to constants) Message-ID: <1479@haddock.ISC.COM> Date: Fri, 23-Oct-87 11:29:23 EST Article-I.D.: haddock.1479 Posted: Fri Oct 23 11:29:23 1987 Date-Received: Sun, 25-Oct-87 16:06:47 EST References: <4663@elroy.Jpl.Nasa.Gov> <31174@sun.uucp> <8792@utzoo.UUCP> <2577@zeus.TEK.COM> Reply-To: karl@haddock.ima.isc.com (Karl Heuer) Organization: Interactive Systems, Boston Lines: 24 Henry Spencer writes: |For those barbarous folk who prefer hexadecimal to octal (God clearly meant |man to use octal, the thumbs are parity bits), X3J11 has added hex string |escapes. No, God clearly meant Man to use hex, storing one nibble on the non-thumb bits of each hand. Dan Tilque replies: >What's the format of these hex string escapes? "\x" followed by hex digits. This was originally going to be limited to three digits (which allows for implementations having up to 12-bit chars), but last I heard X3J11 was going to make them unlimited. I believe unlimited is the better choice, but I think the syntax should include an option to forcibly terminate the character: "\x(1B)A" for ESC-A. I know I could write "\x1B""A", but I also want to be able to write '\x(1B)A' (multi-byte character constants are implementation-defined but not illegal). Moreover, programs other than the C compiler already accept C-like escapes and will likely pick up the new mnemonics; it's unreasonable to expect them all to have string pasting too. Karl W. Z. Heuer (ima!haddock!karl or karl@haddock.isc.com), The Walking Lint