Kernel Hacks & Weird Filenames

Guy Harris guy at gorodish.Sun.COM
Wed May 11 10:09:46 AEST 1988


> If done in the terminal driver, new stty options could be added to say
> what characters are to be considered unprintable. This could break
> some things which like to setup terminals by using "cat foo" where foo
> is a file full of special characters

It also breaks just about any program that uses "termcap", "terminfo", or
"curses", unless all such programs turn off all at special processing.

> I think modifying ls to display filenames with unprintable character
> sets is a bit less tidy.

Perhaps, although it's already been done both in the 4BSD "ls" and the S5R2
"ls".

> Perhaps it could pick up a printable character set from an environment
> variable.

This functionality is specified by the current ANSI C drafts; you do

	setlocale(LC_CTYPE, "");

or

	setlocale(LC_ALL, "");

and the <ctype.h> macros switch to using the appropriate locale's rules.
According to the last POSIX draft, the appropriate locale can be specified by
setting the LANG, LC_ALL, or LC_CTYPE environment variables.



More information about the Comp.unix.wizards mailing list