Path: utzoo!utgpu!jarvis.csri.toronto.edu!cs.utexas.edu!samsung!think!snorkelwacker!spdcc!ima!haddock!karl From: karl@haddock.ima.isc.com (Karl Heuer) Newsgroups: comp.std.c Subject: Re: ANSI draft interpretation questions Message-ID: <15620@haddock.ima.isc.com> Date: 11 Jan 90 19:07:56 GMT References: <21623@mimsy.umd.edu> <11879@smoke.BRL.MIL> <21675@mimsy.umd.edu> <11897@smoke.BRL.MIL> <21690@mimsy.umd.edu> <11907@smoke.BRL.MIL> <15618@haddock.ima.isc.com> Reply-To: karl@haddock.ima.isc.com (Karl Heuer) Organization: Interactive Systems, Cambridge, MA 02138-5302 Lines: 16 In article <15618@haddock.ima.isc.com> karl@haddock.ima.isc.com (Karl Heuer) writes: >Suppose MB_LEN_MAX == 2 and that '@' is a two-byte character whose bytes are >{0x84, 0x30}. If I call scanf("@") and the input stream contains 0x84 0x31, >does it push back one byte or two? To answer my own question: one, apparently. Each ordinary multibyte character is a single directive, which causes characters (bytes) to be read from the stream, and in case of mismatch the differing and subsequent characters remain unread. If "character" had been intended to mean "multibyte character" here, they would have said so, and it would have been singular instead of plural. So it seems that the forces in favor of minimal pushback felt so strongly about it that they were even willing to leave the input stream in an unknown shift state! Karl W. Z. Heuer (karl@haddock.isc.com or ima!haddock!karl), The Walking Lint