Path: utzoo!utgpu!water!watmath!clyde!ima!haddock!karl From: karl@haddock.ISC.COM (Karl Heuer) Newsgroups: comp.lang.c Subject: Re: trigraphs in X3J11 Message-ID: <4394@haddock.ISC.COM> Date: 3 Jun 88 05:59:44 GMT References: <8806021259.AA21135@decwrl.dec.com> Reply-To: karl@haddock.ima.isc.com (Karl Heuer) Organization: Interactive Systems, Boston Lines: 23 In article <8806021259.AA21135@decwrl.dec.com> minow@thundr.dec.com (Martin Minow THUNDR::MINOW ML3-5/U26 223-9922) writes: >[A Swedish user] writes his first program as: > ??= include> main() ??< printf("H{lsningar fr}n Visby p} \land!??/n"); ??> >When he runs my compiler, How does it know that the charcter whose value >is decimal 92 is a national letter, and not a backslash that crept in? >Do I need command line arguments or a ??=pragma? Are they permitted by >the standard? It's up to the implementation to specify the character set. You could have one translator which believes `\' is a backslash, and a different one which believes it's a national letter. You can select which of these two implementations is to compile the program by using a command-line argument. >Will all ??=include files be required to be distributed in their >trigraphed format? It isn't necessary; you could supply a different set of include files with the two implementations. (E.g. `cc -{' could mean `interpret {|}[\] as national characters and use /usr/include/swedish/*.h, while `cc +{' means `interpret them as punctuation and use /usr/include/ascii/*.h'.) Karl W. Z. Heuer (ima!haddock!karl or karl@haddock.isc.com), The Walking Lint