[comp.unix.wizards] Just 8 bits out

steve@eleazar.dartmouth.edu (Steve Campbell) (10/11/88)

I have a foreign language application that needs to send 8-bit characters
to the terminal.  On our 4.3BSD system the only way I can do this is with
RAW mode, and that does lots of other stuff I *dont't* want to do - like
defeating input character functions and fiddling with CR/LF on output.

Isn't there a way under BSD just to get 8-bit output?  There should be.

							Steve Campbell

ed@mtxinu.UUCP (Ed Gould) (10/12/88)

>Isn't there a way under BSD just to get 8-bit output?  There should be.

The bit to set for exactly this purpose is LLITOUT.  It's in the
local modes word.  See tty(4) for details.

-- 
Ed Gould                    mt Xinu, 2560 Ninth St., Berkeley, CA  94710  USA
{ucbvax,uunet}!mtxinu!ed    +1 415 644 0146

"I'll fight them as a woman, not a lady.  I'll fight them as an engineer."

robert@pvab.UUCP (Robert Claeson) (10/13/88)

In article <666@mtxinu.UUCP>, ed@mtxinu.UUCP (Ed Gould) writes:

> >Isn't there a way under BSD just to get 8-bit output?  There should be.
> 
> The bit to set for exactly this purpose is LLITOUT.  It's in the
> local modes word.  See tty(4) for details.

I think that disables output processing as well. It might or might not
work for the particular application Mr. Gould was describing. Anyway,
this does not enable 8-bit character input (I know he wasn't asking for
this, but if the application uses 8-bit characters, he might want to input
8-bit characters as well).
-- 
Robert Claeson, ERBE DATA AB, P.O. Box 77, S-175 22 Jarfalla, Sweden
Tel: +46 758-202 50   Fax: +46 758-197 20
Email: robert@pvab.se (soon rclaeson@erbe.se)

guy@auspex.UUCP (Guy Harris) (10/19/88)

>> >Isn't there a way under BSD just to get 8-bit output?  There should be.
>> 
>> The bit to set for exactly this purpose is LLITOUT.  It's in the
>> local modes word.  See tty(4) for details.
>
>I think that disables output processing as well.

It does.

>Anyway, this does not enable 8-bit character input (I know he wasn't asking
>for this, but if the application uses 8-bit characters, he might want to input
>8-bit characters as well).

In 4.3BSD you can turn on PASS8 which will give you 8-bit character
input.  However, you still can't get 8-bit output without turning other
output processing off.

This will, presumably, be fixed in whatever future release of BSD has
a POSIX-compatible tty driver.  Some systems commonly thought of as BSD
systems can already handle 8-bit output without completely turning
output processing off, e.g. SunOS 4.0 (which has a POSIX-style - I'd say
"POSIX-compatible", except that IEXTEN or whatever it's called wasn't in
POSIX in time to get it into 4.0 - tty driver, with a BSD compatibility
streams module atop it).  Setting PASS8 in SunOS 4.0 gives you 8 bits in
both directions.

loverso@xenna.Encore.COM (John Robert LoVerso) (10/25/88)

In article <17@auspex.UUCP> guy@auspex.UUCP (Guy Harris) writes:
> In 4.3BSD you can turn on PASS8 which will give you 8-bit character
> input.  However, you still can't get 8-bit output without turning other
> output processing off.
> 
> ...Setting PASS8 in SunOS 4.0 gives you 8 bits in both directions.

Unfortunately, 4.3BSD (and SunOS up to 3.5) has a bug in the implementation
of PASS8.  Cooked input liternal next processing `quotes' a character
by setting the 8th bit.  Thus, by turning on PASS8 and then inputing
something innocuous like ^Vx, a read will really return 'x'|0200.  This
makes PASS8 somewhat useless for input of multi-lingual character sets,
not to mention making the csh/sh barf (they expect 7 bits only).

This isn't fixed in 4.3BSD-Tahoe.  It is SunOS4.0.

John Robert LoVerso, Encore Computer Corp
encore!loverso, loverso@Encore.COM

guy@auspex.UUCP (Guy Harris) (10/26/88)

>Unfortunately, 4.3BSD (and SunOS up to 3.5) has a bug in the implementation
>of PASS8.  Cooked input liternal next processing `quotes' a character
>by setting the 8th bit.  Thus, by turning on PASS8 and then inputing
>something innocuous like ^Vx, a read will really return 'x'|0200.  This
>makes PASS8 somewhat useless for input of multi-lingual character sets,

Well, not completely useless; the work-around (admittedly grotty) is not
to use ^V.

However, what makes it much less useful is the fact that turning PASS8
on doesn't give you an 8-bit *output* path, so the system won't be able
to print - or even echo - those nice 8-bit characters....

>not to mention making the csh/sh barf (they expect 7 bits only).

...since they also use the 8th bit internally for quoting characters.

>This isn't fixed in 4.3BSD-Tahoe.

Although it is presumably fixed in the future POSIX-compliant BSD tty
driver (right, Marc?).  I don't know whether they'll fix the Bourne or C
shells then or not.

> It is SunOS4.0.

The tty driver problem is fixed (since it is completely different
internally).  The "sh" problem is also fixed (since it uses the S5R3.1
Bourne shell, which no longer uses the 8th bit for quoting).  The "csh"
problem is not fixed in SunOS 4.0 (although it may be fixed in a future
release). 

marc@monet.Berkeley.EDU (Marc Teitelbaum) (11/02/88)

It's true that PASS8 and literal next (or "\") don't live a happy
co-existance.  To have both function requires a bit more work than was
probably affordable at the time.  The next release of BSD fixes
the problem.

Marc

-------------------------------
Marc Teitelbaum			+1-415-643-6448
457 Evans Hall
Computer Systems Research Group,  CSRG / DEC
University of California
Berkeley, CA 94720